on master help sign in
Always store the log file under home dir.
commit3f6f82b0c4c826df49dc7d37659257943975f67d authorBlaž Hrastnik <blaz@mxxn.io> dateFri 19 Feb 2021, 16:48 (6 years ago) parent8c82f8f
5 files changed+6−1
Cargo.lock+1 helix-term/Cargo.toml+2 helix-term/src/helix.log helix-term/src/main.rs+3−1 helix-term/src/ui/helix.log
Cargo.lock+1
@@ -592,6 +592,7 @@ dependencies = [
592592 "chrono",
593593 "clap",
594594 "crossterm",
595+ "dirs-next",
595596 "fern",
596597 "futures-util",
597598 "fuzzy-matcher",
helix-term/Cargo.toml+2
@@ -37,3 +37,5 @@ log = "0.4"
3737# File picker
3838fuzzy-matcher = "0.3"
3939ignore = "0.4"
40+# shellexpand = "2.1"
41+dirs-next = "2.0"
helix-term/src/helix.logdeleted

No changes to the content.

helix-term/src/main.rs+3−1
@@ -31,6 +31,8 @@ fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
3131 _3_or_more => base_config.level(log::LevelFilter::Trace),
3232 };
3333
34+ let home = dirs_next::home_dir().expect("can't find the home directory");
35+
3436 // Separate file config so we can include year, month and day in file logs
3537 let file_config = fern::Dispatch::new()
3638 .format(|out, message, record| {
@@ -42,7 +44,7 @@ fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
4244 message
4345 ))
4446 })
45− .chain(fern::log_file("helix.log")?);
47+ .chain(fern::log_file(home.join("helix.log"))?);
4648
4749 base_config.chain(file_config).apply()?;
4850
helix-term/src/ui/helix.logdeleted

No changes to the content.