mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Set up logger in cli
This commit is contained in:
parent
a6ed00ad33
commit
710b945b03
3 changed files with 20 additions and 1 deletions
16
Cargo.lock
generated
16
Cargo.lock
generated
|
@ -537,6 +537,19 @@ dependencies = [
|
|||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
|
||||
dependencies = [
|
||||
"humantime",
|
||||
"is-terminal",
|
||||
"log",
|
||||
"regex",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "erased-serde"
|
||||
version = "0.3.25"
|
||||
|
@ -1096,6 +1109,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"clap 4.2.5",
|
||||
"console",
|
||||
"env_logger 0.10.0",
|
||||
"full_moon",
|
||||
"futures-util",
|
||||
"include_dir",
|
||||
|
@ -1444,7 +1458,7 @@ dependencies = [
|
|||
"clap 2.34.0",
|
||||
"cookie",
|
||||
"dirs",
|
||||
"env_logger",
|
||||
"env_logger 0.9.3",
|
||||
"log",
|
||||
"plist",
|
||||
"winapi",
|
||||
|
|
|
@ -31,6 +31,7 @@ serde_yaml.workspace = true
|
|||
tokio.workspace = true
|
||||
|
||||
anyhow = "1.0"
|
||||
env_logger = "0.10"
|
||||
|
||||
clap = { version = "4.1", features = ["derive"] }
|
||||
full_moon = { version = "0.17", features = ["roblox"] }
|
||||
|
|
|
@ -24,6 +24,10 @@ use console::style;
|
|||
|
||||
#[tokio::main(flavor = "multi_thread")]
|
||||
async fn main() -> ExitCode {
|
||||
let logger_env = env_logger::Env::default().default_filter_or("error");
|
||||
env_logger::Builder::from_env(logger_env)
|
||||
.format_timestamp(None)
|
||||
.init();
|
||||
match Cli::parse().run().await {
|
||||
Ok(code) => code,
|
||||
Err(err) => {
|
||||
|
|
Loading…
Reference in a new issue