Skip to content

Commit

Permalink
lenient log
Browse files Browse the repository at this point in the history
  • Loading branch information
Kailai-Wang committed May 31, 2024
1 parent dbcac65 commit fec6528
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions tee-worker/enclave-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,29 @@ pub unsafe extern "C" fn init(
encoded_base_dir_size: u32,
) -> sgx_status_t {
// Initialize the logging environment in the enclave.
if_development_or!(
env_logger::builder()
.format_timestamp(Some(env_logger::TimestampPrecision::Micros))
.init(),
{
let module_names = litentry_proc_macros::local_modules!();
println!(
"Initializing logger to filter only following local modules: {:?}",
module_names
);
let mut builder = env_logger::Builder::new();
builder.format_timestamp(Some(env_logger::TimestampPrecision::Micros));
builder.filter(None, LevelFilter::Off);
module_names.into_iter().for_each(|module| {
builder.filter(Some(module), LevelFilter::Info);
});
builder.init();
}
);
// if_development_or!(
// env_logger::builder()
// .format_timestamp(Some(env_logger::TimestampPrecision::Micros))
// .init(),
// {
// let module_names = litentry_proc_macros::local_modules!();
// println!(
// "Initializing logger to filter only following local modules: {:?}",
// module_names
// );
// let mut builder = env_logger::Builder::new();
// builder.format_timestamp(Some(env_logger::TimestampPrecision::Micros));
// builder.filter(None, LevelFilter::Off);
// module_names.into_iter().for_each(|module| {
// builder.filter(Some(module), LevelFilter::Info);
// });
// builder.init();
// }
// );

env_logger::builder()
.format_timestamp(Some(env_logger::TimestampPrecision::Micros))
.init();

let mu_ra_url =
match String::decode(&mut slice::from_raw_parts(mu_ra_addr, mu_ra_addr_size as usize))
Expand Down

0 comments on commit fec6528

Please sign in to comment.