mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
By default, log only to stderr, and not to disk.
This fixes a common problem when running under VS Code, the user doesn't have permissions to create a `log` directory in the CWD. The old behavior can be re-enabled by setting RA_INTERNAL_MODE=1
This commit is contained in:
parent
1875aa024f
commit
8b1e667077
1 changed files with 5 additions and 5 deletions
|
@ -6,11 +6,11 @@ use ra_lsp_server::Result;
|
|||
|
||||
fn main() -> Result<()> {
|
||||
::std::env::set_var("RUST_BACKTRACE", "short");
|
||||
Logger::with_env_or_str("error")
|
||||
.duplicate_to_stderr(Duplicate::All)
|
||||
.log_to_file()
|
||||
.directory("log")
|
||||
.start()?;
|
||||
let logger = Logger::with_env_or_str("error").duplicate_to_stderr(Duplicate::All);
|
||||
match ::std::env::var("RA_INTERNAL_MODE") {
|
||||
Ok(ref v) if v == "1" => logger.log_to_file().directory("log").start()?,
|
||||
_ => logger.start()?,
|
||||
};
|
||||
log::info!("lifecycle: server started");
|
||||
match ::std::panic::catch_unwind(main_inner) {
|
||||
Ok(res) => {
|
||||
|
|
Loading…
Reference in a new issue