mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
This commit is contained in:
parent
1f5209a41b
commit
12fa839120
2 changed files with 27 additions and 11 deletions
|
@ -763,13 +763,14 @@ impl Output {
|
|||
/// Log to `$ERG_PATH/els.log`
|
||||
pub fn lsp_log(file: &str, line: u32, msg: &str) {
|
||||
let file_path = erg_path().join("els.log");
|
||||
let mut f = if file_path.exists() {
|
||||
File::options().append(true).open(file_path).unwrap()
|
||||
let Ok(mut f) = (if file_path.exists() {
|
||||
File::options().append(true).open(file_path)
|
||||
} else {
|
||||
File::create(file_path).unwrap()
|
||||
File::create(file_path)
|
||||
}) else {
|
||||
return;
|
||||
};
|
||||
f.write_all(format!("{file}@{line}: {msg}\n").as_bytes())
|
||||
.unwrap();
|
||||
let _ = f.write_all(format!("{file}@{line}: {msg}\n").as_bytes());
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue