Loading src/common/log.c +7 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,13 @@ #define raw_assert(x) assert(x) // assert OK /** Defining compile-time constants for Tor log levels (used by the Rust * log wrapper at src/rust/tor_log) */ const int _LOG_WARN = LOG_WARN; const int _LOG_NOTICE = LOG_NOTICE; const log_domain_mask_t _LD_GENERAL = LD_GENERAL; const log_domain_mask_t _LD_NET = LD_NET; /** Information for a single logfile; only used in log.c */ typedef struct logfile_t { struct logfile_t *next; /**< Next logfile_t in the linked list. */ Loading src/common/torlog.h +10 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,16 @@ * "maximum severity" read "most severe" and "numerically *lowest* severity". */ /** This defines log levels that are linked in the Rust log module, rather * than re-defining these in both Rust and C. * * C_RUST_COUPLED src/rust/tor_log LogSeverity, LogDomain */ extern const int _LOG_WARN; extern const int _LOG_NOTICE; extern const log_domain_mask_t _LD_NET; extern const log_domain_mask_t _LD_GENERAL; /** Debug-level severity: for hyper-verbose messages of no interest to * anybody but developers. */ #define LOG_DEBUG 7 Loading src/or/main.c +2 −6 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ void evdns_shutdown(int); #ifdef HAVE_RUST // helper function defined in Rust to output a log message indicating if tor is // running with Rust enabled. See src/rust/tor_util char *rust_welcome_string(void); void rust_welcome_string(void); #endif /********* PROTOTYPES **********/ Loading Loading @@ -3283,11 +3283,7 @@ tor_init(int argc, char *argv[]) } #ifdef HAVE_RUST char *rust_str = rust_welcome_string(); if (rust_str != NULL && strlen(rust_str) > 0) { log_notice(LD_GENERAL, "%s", rust_str); } tor_free(rust_str); rust_welcome_string(); #endif /* defined(HAVE_RUST) */ if (network_init()<0) { Loading src/rust/Cargo.lock +10 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ version = "0.0.1" dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "tor_allocate 0.0.1", "tor_log 0.1.0", ] [[package]] Loading @@ -26,6 +27,7 @@ dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "smartlist 0.0.1", "tor_allocate 0.0.1", "tor_log 0.1.0", "tor_util 0.0.1", ] Loading @@ -43,6 +45,14 @@ dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tor_log" version = "0.1.0" dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "tor_allocate 0.0.1", ] [[package]] name = "tor_rust" version = "0.1.0" Loading src/rust/Cargo.toml +2 −1 Original line number Diff line number Diff line [workspace] members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust"] members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust", "tor_log"] [profile.release] debug = true Loading Loading
src/common/log.c +7 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,13 @@ #define raw_assert(x) assert(x) // assert OK /** Defining compile-time constants for Tor log levels (used by the Rust * log wrapper at src/rust/tor_log) */ const int _LOG_WARN = LOG_WARN; const int _LOG_NOTICE = LOG_NOTICE; const log_domain_mask_t _LD_GENERAL = LD_GENERAL; const log_domain_mask_t _LD_NET = LD_NET; /** Information for a single logfile; only used in log.c */ typedef struct logfile_t { struct logfile_t *next; /**< Next logfile_t in the linked list. */ Loading
src/common/torlog.h +10 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,16 @@ * "maximum severity" read "most severe" and "numerically *lowest* severity". */ /** This defines log levels that are linked in the Rust log module, rather * than re-defining these in both Rust and C. * * C_RUST_COUPLED src/rust/tor_log LogSeverity, LogDomain */ extern const int _LOG_WARN; extern const int _LOG_NOTICE; extern const log_domain_mask_t _LD_NET; extern const log_domain_mask_t _LD_GENERAL; /** Debug-level severity: for hyper-verbose messages of no interest to * anybody but developers. */ #define LOG_DEBUG 7 Loading
src/or/main.c +2 −6 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ void evdns_shutdown(int); #ifdef HAVE_RUST // helper function defined in Rust to output a log message indicating if tor is // running with Rust enabled. See src/rust/tor_util char *rust_welcome_string(void); void rust_welcome_string(void); #endif /********* PROTOTYPES **********/ Loading Loading @@ -3283,11 +3283,7 @@ tor_init(int argc, char *argv[]) } #ifdef HAVE_RUST char *rust_str = rust_welcome_string(); if (rust_str != NULL && strlen(rust_str) > 0) { log_notice(LD_GENERAL, "%s", rust_str); } tor_free(rust_str); rust_welcome_string(); #endif /* defined(HAVE_RUST) */ if (network_init()<0) { Loading
src/rust/Cargo.lock +10 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ version = "0.0.1" dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "tor_allocate 0.0.1", "tor_log 0.1.0", ] [[package]] Loading @@ -26,6 +27,7 @@ dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "smartlist 0.0.1", "tor_allocate 0.0.1", "tor_log 0.1.0", "tor_util 0.0.1", ] Loading @@ -43,6 +45,14 @@ dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tor_log" version = "0.1.0" dependencies = [ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "tor_allocate 0.0.1", ] [[package]] name = "tor_rust" version = "0.1.0" Loading
src/rust/Cargo.toml +2 −1 Original line number Diff line number Diff line [workspace] members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust"] members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust", "tor_log"] [profile.release] debug = true Loading