@@ -19,12 +19,24 @@ use std::sync::{Arc, Mutex};
1919use hyperlight_common:: flatbuffer_wrappers:: function_types:: { FunctionCallResult , ParameterValue } ;
2020use hyperlight_common:: flatbuffer_wrappers:: guest_error:: { ErrorCode , GuestError } ;
2121use hyperlight_common:: flatbuffer_wrappers:: guest_log_data:: GuestLogData ;
22+ use hyperlight_common:: flatbuffer_wrappers:: guest_log_level:: Level as GuestLevel ;
2223use hyperlight_common:: outb:: { Exception , OutBAction } ;
2324use tracing:: { Span , instrument} ;
24- use tracing_log:: { LogTracer , format_trace, log} ;
25+ use tracing_log:: { format_trace, log} ;
2526
2627use log:: { Level , Record } ;
2728
29+ // Convert from guest Level to log Level
30+ fn guest_level_to_log_level ( guest_level : GuestLevel ) -> Level {
31+ match guest_level {
32+ GuestLevel :: Trace => Level :: Trace ,
33+ GuestLevel :: Debug => Level :: Debug ,
34+ GuestLevel :: Info => Level :: Info ,
35+ GuestLevel :: Warn => Level :: Warn ,
36+ GuestLevel :: Error => Level :: Error ,
37+ }
38+ }
39+
2840use super :: host_funcs:: FunctionRegistry ;
2941#[ cfg( feature = "mem_profile" ) ]
3042use crate :: hypervisor:: regs:: CommonRegisters ;
@@ -45,7 +57,7 @@ pub(super) fn outb_log(mgr: &mut SandboxMemoryManager<HostSharedMemory>) -> Resu
4557
4658 let log_data: GuestLogData = mgr. read_guest_log_data ( ) ?;
4759
48- let record_level: Level = ( & log_data. level ) . into ( ) ;
60+ let record_level: Level = guest_level_to_log_level ( ( & log_data. level ) . into ( ) ) ;
4961
5062 // Work out if we need to log or trace
5163 // this API is marked as follows but it is the easiest way to work out if we should trace or log
0 commit comments