generated from PlexSheep/baserepo
add uptime to init
cargo devel CI / cargo CI (push) Has been cancelled
Details
cargo devel CI / cargo CI (push) Has been cancelled
Details
This commit is contained in:
parent
5443acef3e
commit
c968e44349
|
@ -75,7 +75,7 @@ impl Logger {
|
||||||
/// Will enable the logger to be used.
|
/// Will enable the logger to be used.
|
||||||
///
|
///
|
||||||
/// Assumes some defaults, use [`init_customized`](Self::init_customized) for more control
|
/// Assumes some defaults, use [`init_customized`](Self::init_customized) for more control
|
||||||
pub fn init(log_dir: Option<PathBuf>, max_level: Option<Level>) -> Result<()> {
|
pub fn init(log_dir: Option<PathBuf>, max_level: Option<Level>, uptime: bool) -> Result<()> {
|
||||||
Self::init_customized(
|
Self::init_customized(
|
||||||
log_dir.is_some(),
|
log_dir.is_some(),
|
||||||
log_dir.unwrap_or(PathBuf::from(DEFAULT_LOG_DIR)),
|
log_dir.unwrap_or(PathBuf::from(DEFAULT_LOG_DIR)),
|
||||||
|
@ -89,7 +89,7 @@ impl Logger {
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
false,
|
uptime,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if cli.log_meta {
|
if cli.log_meta {
|
||||||
Logger::init(None, Some(ll)).expect("could not initialize Logger");
|
Logger::init(None, Some(ll), false).expect("could not initialize Logger");
|
||||||
} else {
|
} else {
|
||||||
// less verbose version
|
// less verbose version
|
||||||
Logger::init_mini(Some(ll)).expect("could not initialize Logger");
|
Logger::init_mini(Some(ll)).expect("could not initialize Logger");
|
||||||
|
|
|
@ -165,7 +165,7 @@ fn cli_parse() -> Cli {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if cli.meta {
|
if cli.meta {
|
||||||
Logger::init(None, Some(ll)).expect("could not initialize Logger");
|
Logger::init(None, Some(ll), false).expect("could not initialize Logger");
|
||||||
} else {
|
} else {
|
||||||
// less verbose version
|
// less verbose version
|
||||||
Logger::init_mini(Some(ll)).expect("could not initialize Logger");
|
Logger::init_mini(Some(ll)).expect("could not initialize Logger");
|
||||||
|
|
Reference in New Issue