mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Merge #284
284: By default, log only to stderr, and not to disk. r=matklad a=eminence 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` Fixes #282 Co-authored-by: Andrew Chin <achin@eminence32.net>
This commit is contained in:
commit
4a1ab869b7
1 changed files with 5 additions and 5 deletions
|
@ -6,11 +6,11 @@ use ra_lsp_server::Result;
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
::std::env::set_var("RUST_BACKTRACE", "short");
|
::std::env::set_var("RUST_BACKTRACE", "short");
|
||||||
Logger::with_env_or_str("error")
|
let logger = Logger::with_env_or_str("error").duplicate_to_stderr(Duplicate::All);
|
||||||
.duplicate_to_stderr(Duplicate::All)
|
match ::std::env::var("RA_INTERNAL_MODE") {
|
||||||
.log_to_file()
|
Ok(ref v) if v == "1" => logger.log_to_file().directory("log").start()?,
|
||||||
.directory("log")
|
_ => logger.start()?,
|
||||||
.start()?;
|
};
|
||||||
log::info!("lifecycle: server started");
|
log::info!("lifecycle: server started");
|
||||||
match ::std::panic::catch_unwind(main_inner) {
|
match ::std::panic::catch_unwind(main_inner) {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue