This sample shows how to use env_logger in an Rust-SGX enclave. We maintain a SGX fork of [env_logger] at:
https://github.com/mesalock-linux/env_logger-sgx
It is keep updated with its upstream's Github repo. It depends on a SGX fork of log at:
https://github.com/mesalock-linux/log-sgx
$ make $ cd bin $ RUST_LOG=trace ./app
$ make $ cd bin $ RUST_LOG=info ./app
To use env_logger, one must be sure the TCSPolicy
is 0
.
To use env_logger, one must include sgx_env.edl
in the enclave's EDL file.
In Cargo.toml, bring in log and env_logger:
log = { git = "https://github.com/mesalock-linux/log-sgx" } env_logger = { git = "https://github.com/mesalock-linux/env_logger-sgx" }
#[macro_use] extern crate log extern crate env_logger;
env_logger::init(); info!("starting up");
$ make $ cd bin $ RUST_LOG=trace ./app