diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/main.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/main.rs b/crates/ra_lsp_server/src/main.rs index e13c8ca14..8076a7fa5 100644 --- a/crates/ra_lsp_server/src/main.rs +++ b/crates/ra_lsp_server/src/main.rs | |||
@@ -1,6 +1,5 @@ | |||
1 | //! `ra_lsp_server` binary | 1 | //! `ra_lsp_server` binary |
2 | 2 | ||
3 | use flexi_logger::{Duplicate, Logger}; | ||
4 | use lsp_server::Connection; | 3 | use lsp_server::Connection; |
5 | use ra_lsp_server::{show_message, Result, ServerConfig}; | 4 | use ra_lsp_server::{show_message, Result, ServerConfig}; |
6 | use ra_prof; | 5 | use ra_prof; |
@@ -14,11 +13,7 @@ fn main() -> Result<()> { | |||
14 | fn setup_logging() -> Result<()> { | 13 | fn setup_logging() -> Result<()> { |
15 | std::env::set_var("RUST_BACKTRACE", "short"); | 14 | std::env::set_var("RUST_BACKTRACE", "short"); |
16 | 15 | ||
17 | let logger = Logger::with_env_or_str("error").duplicate_to_stderr(Duplicate::All); | 16 | env_logger::try_init()?; |
18 | match std::env::var("RA_LOG_DIR") { | ||
19 | Ok(ref v) if v == "1" => logger.log_to_file().directory("log").start()?, | ||
20 | _ => logger.start()?, | ||
21 | }; | ||
22 | 17 | ||
23 | ra_prof::set_filter(match std::env::var("RA_PROFILE") { | 18 | ra_prof::set_filter(match std::env::var("RA_PROFILE") { |
24 | Ok(spec) => ra_prof::Filter::from_spec(&spec), | 19 | Ok(spec) => ra_prof::Filter::from_spec(&spec), |