aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-15 16:05:52 -0700
committerFuwn <[email protected]>2021-05-15 16:05:52 -0700
commitec4c3643e09dbe0010c7bbf64325e11c0f915bca (patch)
tree1931e3486468b1ff31b38af80157cfa08cfe4764
parentchore(git): normilize eol to lf (diff)
downloadwhirl-ec4c3643e09dbe0010c7bbf64325e11c0f915bca.tar.xz
whirl-ec4c3643e09dbe0010c7bbf64325e11c0f915bca.zip
feat(global): logs now go to a dedicated directory and file
-rw-r--r--.gitignore1
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs6
3 files changed, 7 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index c6eac39..f18a778 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@ Cargo.lock
/whirl.sqlite3
/Whirl.toml
/.secrets
+/log/
# DB Browser
/whirl.sqlite3-shm
diff --git a/Cargo.toml b/Cargo.toml
index 88dad31..17e0a1b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ dotenv = "0.15.0"
# Logging
log = "0.4.14"
-pretty_env_logger = "0.4.0"
+flexi_logger = "0.17.1"
# Utility
rand = "0.8.3"
diff --git a/src/main.rs b/src/main.rs
index 2171243..0b3899d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -12,7 +12,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
// Logging
dotenv::dotenv().ok();
- pretty_env_logger::init();
+ flexi_logger::Logger::with_str("trace")
+ .log_to_file()
+ .directory("log")
+ .print_message()
+ .start()?;
// Execution
Cli::execute(matches).await;