refact: env logger, filter modules
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ tungstenite = { version = "0.26", features = ["native-tls", "rustls-tls-native-r
|
|||||||
rustls-platform-verifier = "0.6"
|
rustls-platform-verifier = "0.6"
|
||||||
rustls-pki-types = "1.11"
|
rustls-pki-types = "1.11"
|
||||||
rustls-native-certs = "0.8"
|
rustls-native-certs = "0.8"
|
||||||
webpki-roots = "1.0"
|
webpki-roots = "1.0.3"
|
||||||
async-recursion = "1.1"
|
async-recursion = "1.1"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||||
|
|||||||
+2
-2
@@ -370,7 +370,7 @@ pub fn init_log(_is_async: bool, _name: &str) -> Option<flexi_logger::LoggerHand
|
|||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
use env_logger::*;
|
use env_logger::*;
|
||||||
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info"));
|
init_from_env(Env::default().filter_or(DEFAULT_FILTER_ENV, "info,reqwest=warn,rustls=warn"));
|
||||||
}
|
}
|
||||||
#[cfg(not(debug_assertions))]
|
#[cfg(not(debug_assertions))]
|
||||||
{
|
{
|
||||||
@@ -385,7 +385,7 @@ pub fn init_log(_is_async: bool, _name: &str) -> Option<flexi_logger::LoggerHand
|
|||||||
path.push(_name);
|
path.push(_name);
|
||||||
}
|
}
|
||||||
use flexi_logger::*;
|
use flexi_logger::*;
|
||||||
if let Ok(x) = Logger::try_with_env_or_str("debug") {
|
if let Ok(x) = Logger::try_with_env_or_str("debug,reqwest=warn,rustls=warn") {
|
||||||
logger_holder = x
|
logger_holder = x
|
||||||
.log_to_file(FileSpec::default().directory(path))
|
.log_to_file(FileSpec::default().directory(path))
|
||||||
.write_mode(if _is_async {
|
.write_mode(if _is_async {
|
||||||
|
|||||||
Reference in New Issue
Block a user