Use env_logger when running the app in a terminal
This commit is contained in:
parent
c105802b2d
commit
0a3f013e00
2 changed files with 3 additions and 4 deletions
|
@ -64,6 +64,7 @@ crossbeam-channel = "0.5.0"
|
|||
ctor = "0.1.20"
|
||||
dirs = "3.0"
|
||||
easy-parallel = "3.1.0"
|
||||
env_logger = "0.8"
|
||||
futures = "0.3"
|
||||
http-auth-basic = "0.1.3"
|
||||
ignore = "0.4"
|
||||
|
|
|
@ -9,7 +9,6 @@ use gpui::{App, AssetSource, Task};
|
|||
use log::LevelFilter;
|
||||
use parking_lot::Mutex;
|
||||
use project::Fs;
|
||||
use simplelog::SimpleLogger;
|
||||
use smol::process::Command;
|
||||
use std::{env, fs, path::PathBuf, sync::Arc};
|
||||
use theme::{ThemeRegistry, DEFAULT_THEME_NAME};
|
||||
|
@ -142,11 +141,10 @@ fn main() {
|
|||
}
|
||||
|
||||
fn init_logger() {
|
||||
let level = LevelFilter::Info;
|
||||
|
||||
if stdout_is_a_pty() {
|
||||
SimpleLogger::init(level, Default::default()).expect("could not initialize logger");
|
||||
env_logger::init();
|
||||
} else {
|
||||
let level = LevelFilter::Info;
|
||||
let log_dir_path = dirs::home_dir()
|
||||
.expect("could not locate home directory for logging")
|
||||
.join("Library/Logs/");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue