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"
6
6
edition = " 2018"
7
7
links = " rustls_ffi"
8
8
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
+
9
17
[dependencies ]
10
18
# Keep in sync with RUSTLS_CRATE_VERSION in build.rs
11
19
rustls = { 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 {
30
30
fn flush ( & self ) { }
31
31
}
32
32
33
+ #[ cfg( feature = "no_log_capture" ) ]
34
+ pub ( crate ) fn ensure_log_registered ( ) { }
35
+
36
+ #[ cfg( not( feature = "no_log_capture" ) ) ]
33
37
pub ( crate ) fn ensure_log_registered ( ) {
34
38
log:: set_logger ( & Logger { } ) . ok ( ) ;
35
39
log:: set_max_level ( log:: LevelFilter :: Debug )
You can’t perform that action at this time.
0 commit comments