on master help sign in
Always store the log file under home dir.
3f6f82bBlaž Hrastnik
Cargo.lock+1
@@ -592,6 +592,7 @@ dependencies = [
592 "chrono",
592 "chrono",
593 "clap",
593 "clap",
594 "crossterm",
594 "crossterm",
595+ "dirs-next",
595 "fern",
596 "fern",
596 "futures-util",
597 "futures-util",
597 "fuzzy-matcher",
598 "fuzzy-matcher",
helix-term/Cargo.toml+2
@@ -37,3 +37,5 @@ log = "0.4"
37# File picker
37# File picker
38fuzzy-matcher = "0.3"
38fuzzy-matcher = "0.3"
39ignore = "0.4"
39ignore = "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> {
31 _3_or_more => base_config.level(log::LevelFilter::Trace),
31 _3_or_more => base_config.level(log::LevelFilter::Trace),
32 };
32 };
33
33
34+ let home = dirs_next::home_dir().expect("can't find the home directory");
35+
34 // Separate file config so we can include year, month and day in file logs
36 // Separate file config so we can include year, month and day in file logs
35 let file_config = fern::Dispatch::new()
37 let file_config = fern::Dispatch::new()
36 .format(|out, message, record| {
38 .format(|out, message, record| {
@@ -42,7 +44,7 @@ fn setup_logging(verbosity: u64) -> Result<(), fern::InitError> {
42 message
44 message
43 ))
45 ))
44 })
46 })
45− .chain(fern::log_file("helix.log")?);
47+ .chain(fern::log_file(home.join("helix.log"))?);
46
48
47 base_config.chain(file_config).apply()?;
49 base_config.chain(file_config).apply()?;
48
50
helix-term/src/ui/helix.logdeleted

No changes to the content.