optimize some logs (#3497)

This commit is contained in:
ifengqi 2024-09-12 22:07:34 +08:00 committed by GitHub
parent b8772caefc
commit b09ed0af01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -4034,8 +4034,10 @@ pub fn try_open_in_existing_process(
fn listen_local_socket(tx: Sender<CoreNotification>) -> Result<()> {
let local_socket = Directory::local_socket()
.ok_or_else(|| anyhow!("can't get local socket folder"))?;
if let Err(err) = std::fs::remove_file(&local_socket) {
tracing::error!("{:?}", err);
if local_socket.exists() {
if let Err(err) = std::fs::remove_file(&local_socket) {
tracing::error!("{:?}", err);
}
}
let socket =
interprocess::local_socket::LocalSocketListener::bind(local_socket)?;

View File

@ -1771,7 +1771,9 @@ fn get_grammar(&self) -> Option<tree_sitter::Language> {
return Some(grammar);
}
Err(err) => {
tracing::error!("{:?}", err);
if self != &LapceLanguage::PlainText {
tracing::error!("{:?} {:?}", self, err);
}
}
}
};