diff options
author | rezural <[email protected]> | 2021-06-21 00:33:57 +0100 |
---|---|---|
committer | rezural <[email protected]> | 2021-06-21 00:33:57 +0100 |
commit | baa060a9947f0006a256acdac075691da4168edf (patch) | |
tree | c378f6511d0c0c6b75e36747b9b3be6709dd4f76 | |
parent | 9d60d75e1400ba82ae8d41496d8a0fb9a8edec0c (diff) |
output to log file if RA_LOG_FILE is defined in environment
-rw-r--r-- | crates/rust-analyzer/src/bin/main.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/bin/main.rs b/crates/rust-analyzer/src/bin/main.rs index afc96505f..97246cae6 100644 --- a/crates/rust-analyzer/src/bin/main.rs +++ b/crates/rust-analyzer/src/bin/main.rs | |||
@@ -60,7 +60,14 @@ fn try_main() -> Result<()> { | |||
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | setup_logging(flags.log_file.as_deref(), flags.no_log_buffering)?; | 63 | let mut log_file = flags.log_file.as_deref(); |
64 | |||
65 | let env_log_file = env::var("RA_LOG_FILE").ok(); | ||
66 | if let Some(env_log_file) = env_log_file.as_deref() { | ||
67 | log_file = Some(Path::new(env_log_file)); | ||
68 | } | ||
69 | |||
70 | setup_logging(log_file, flags.no_log_buffering)?; | ||
64 | let verbosity = flags.verbosity(); | 71 | let verbosity = flags.verbosity(); |
65 | 72 | ||
66 | match flags.subcommand { | 73 | match flags.subcommand { |