aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-06-10 10:43:01 +0000
committerFuwn <[email protected]>2021-06-10 10:43:01 +0000
commit14ac174e82e1411a4948f80b41c6e6ad147df426 (patch)
treeaa285f2f2f5a138109c2b9bd0c99a77a17b49128 /crates
parentfix(deps): update rust crate flexi_logger to 0.18.0 (diff)
downloadwhirl-14ac174e82e1411a4948f80b41c6e6ad147df426.tar.xz
whirl-14ac174e82e1411a4948f80b41c6e6ad147df426.zip
fix(whirl): logger definition
`flexi_logger` version `0.18.0` broke a lot of stuff, this fixes those broken things.
Diffstat (limited to 'crates')
-rw-r--r--crates/whirl/src/lib.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/whirl/src/lib.rs b/crates/whirl/src/lib.rs
index 494ba07..02de6e1 100644
--- a/crates/whirl/src/lib.rs
+++ b/crates/whirl/src/lib.rs
@@ -43,7 +43,10 @@ use whirl_config::Config;
pub struct Whirl;
impl Whirl {
/// # Errors
- /// - An error may arise if logger fails to start.
+ /// if the Logger fails to start.
+ ///
+ /// # Panics
+ /// if the Logger fails to be created.
pub async fn splash() -> Result<(), Box<dyn std::error::Error>> {
// Environment
std::env::set_var("DATABASE_URL", ".whirl/db.sqlite3");
@@ -52,7 +55,8 @@ impl Whirl {
dotenv::dotenv().ok();
human_panic::setup_panic!();
if Config::get().whirlsplash.log.enable {
- let logger = flexi_logger::Logger::with_str(whirl_common::log::calculate_log_level());
+ let logger =
+ flexi_logger::Logger::try_with_str(whirl_common::log::calculate_log_level()).unwrap();
if std::env::var("LOG_FILE").unwrap_or_else(|_| "true".to_string()) == "false"
|| !whirl_config::Config::get().whirlsplash.log.file
|| std::env::args().collect::<Vec<_>>()[1] == "clean"
@@ -62,8 +66,7 @@ impl Whirl {
} else {
logger
.print_message()
- .log_to_file()
- .directory(".whirl/log")
+ .log_to_file(flexi_logger::FileSpec::default().directory(".whirl/log"))
.start()?;
}
}