mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 21:10:36 +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",
|
"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]]
|
[[package]]
|
||||||
name = "erased-serde"
|
name = "erased-serde"
|
||||||
version = "0.3.25"
|
version = "0.3.25"
|
||||||
|
@ -1096,6 +1109,7 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap 4.2.5",
|
"clap 4.2.5",
|
||||||
"console",
|
"console",
|
||||||
|
"env_logger 0.10.0",
|
||||||
"full_moon",
|
"full_moon",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"include_dir",
|
"include_dir",
|
||||||
|
@ -1444,7 +1458,7 @@ dependencies = [
|
||||||
"clap 2.34.0",
|
"clap 2.34.0",
|
||||||
"cookie",
|
"cookie",
|
||||||
"dirs",
|
"dirs",
|
||||||
"env_logger",
|
"env_logger 0.9.3",
|
||||||
"log",
|
"log",
|
||||||
"plist",
|
"plist",
|
||||||
"winapi",
|
"winapi",
|
||||||
|
|
|
@ -31,6 +31,7 @@ serde_yaml.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
|
env_logger = "0.10"
|
||||||
|
|
||||||
clap = { version = "4.1", features = ["derive"] }
|
clap = { version = "4.1", features = ["derive"] }
|
||||||
full_moon = { version = "0.17", features = ["roblox"] }
|
full_moon = { version = "0.17", features = ["roblox"] }
|
||||||
|
|
|
@ -24,6 +24,10 @@ use console::style;
|
||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread")]
|
#[tokio::main(flavor = "multi_thread")]
|
||||||
async fn main() -> ExitCode {
|
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 {
|
match Cli::parse().run().await {
|
||||||
Ok(code) => code,
|
Ok(code) => code,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
|
Loading…
Reference in a new issue