File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,14 @@ description = "C-to-rustls bindings"
66edition = " 2018"
77links = " rustls_ffi"
88
9+ [features ]
10+ # Enable this feature when building as Rust dependency. It inhibits the
11+ # default behavior of capturing the global logger, which only works when
12+ # built using the Makefile, which passes -C metadata=rustls-ffi to avoid
13+ # interfering with copies of the global logger brought in by other Rust
14+ # libraries.
15+ no_log_capture = []
16+
917[dependencies ]
1018# Keep in sync with RUSTLS_CRATE_VERSION in build.rs
1119rustls = { version = " =0.20" , features = [ " dangerous_configuration" ] }
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ impl log::Log for Logger {
3030 fn flush ( & self ) { }
3131}
3232
33+ #[ cfg( feature = "no_log_capture" ) ]
34+ pub ( crate ) fn ensure_log_registered ( ) { }
35+
36+ #[ cfg( not( feature = "no_log_capture" ) ) ]
3337pub ( crate ) fn ensure_log_registered ( ) {
3438 log:: set_logger ( & Logger { } ) . ok ( ) ;
3539 log:: set_max_level ( log:: LevelFilter :: Debug )
You can’t perform that action at this time.
0 commit comments