From 699de3c0490a7865c8591be389ef03c4a338e3de Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Thu, 16 Jul 2009 14:35:27 +0200 Subject: [PATCH] Change some logging messages --- src/MacVim/MMAppController.m | 6 +++--- src/MacVim/MMBackend.m | 32 ++++++++++++++++---------------- src/MacVim/MMVimController.m | 28 ++++++++++++++++++---------- src/MacVim/MMWindowController.m | 5 +++-- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index e89303ac00..53b727525d 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -636,12 +636,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef, - (void)removeVimController:(id)controller { - ASLogDebug(@"Remove Vim controller pid=%d id=%d", - [controller pid], [controller identifier]); + ASLogDebug(@"Remove Vim controller pid=%d id=%d (processingFlag=%d)", + [controller pid], [controller identifier], processingFlag); int idx = [vimControllers indexOfObject:controller]; if (NSNotFound == idx) { - ASLogWarn(@"Controller at index=%d not found", idx); + ASLogDebug(@"Controller not found, probably due to duplicate removal"); return; } diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index aad655af13..40f6519fbd 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -346,8 +346,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); identifier = [appProxy connectBackend:self pid:pid]; return YES; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught when trying to connect backend: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"Connect backend failed: reason=%@", ex); } return NO; @@ -510,8 +510,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); debugStringForMessageQueue(outputQueue)); [appProxy processInput:outputQueue forIdentifier:identifier]; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"processInput:forIdentifer failed: reason=%@", ex); if (![connection isValid]) { ASLogNotice(@"Connection is invalid, exit now!"); ASLogDebug(@"waitForAck=%d got_int=%d", waitForAck, got_int); @@ -579,8 +579,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); debugStringForMessageQueue(outputQueue)); [appProxy processInput:outputQueue forIdentifier:identifier]; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught when sending CloseWindowMsgID: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"CloseWindowMsgID send failed: reason=%@", ex); } // NOTE: If Cmd-w was pressed to close the window the menu is briefly @@ -702,8 +702,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); [dialogReturn release]; dialogReturn = nil; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"Exception: reason=%@", ex); } return (char *)s; @@ -757,8 +757,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); [dialogReturn release]; dialogReturn = nil; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"Exception: reason=%@", ex); } return retval; @@ -1320,8 +1320,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); [proxy addInput:string client:self]; } } - @catch (NSException *e) { - ASLogWarn(@"Caught exception: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"Exception: reason=%@", ex); return NO; } @@ -1339,8 +1339,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); @try { list = [proxy serverList]; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught when listing servers: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"serverList failed: reason=%@", ex); } } else { EMSG(_("E???: No connection to MacVim, server listing not possible.")); @@ -1409,8 +1409,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font); [client addReply:reply server:self]; return YES; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"addReply:server: failed: reason=%@", ex); } } else { EMSG2(_("E???: server2client failed; no client with id 0x%x"), port); diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index 75d5e4249f..265d7aad90 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -348,8 +348,9 @@ static BOOL isUnsafeMessage(int msgid); @try { [backendProxy processInput:msgid data:data]; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught during DO call: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"processInput:data: failed: pid=%d id=%d msg=%s reason=%@", + pid, identifier, MessageStrings[msgid], ex); } } @@ -378,8 +379,10 @@ static BOOL isUnsafeMessage(int msgid); @try { [backendProxy processInput:msgid data:data]; } - @catch (NSException *e) { + @catch (NSException *ex) { sendOk = NO; + ASLogNotice(@"processInput:data: failed: pid=%d id=%d msg=%s reason=%@", + pid, identifier, MessageStrings[msgid], ex); } @finally { [conn setRequestTimeout:oldTimeout]; @@ -410,7 +413,8 @@ static BOOL isUnsafeMessage(int msgid); ASLogDebug(@"eval(%@)=%@", expr, eval); } @catch (NSException *ex) { - ASLogWarn(@"Exception caught: %@", ex); + ASLogNotice(@"evaluateExpression: failed: pid=%d id=%d reason=%@", + pid, identifier, ex); } return eval; @@ -426,7 +430,8 @@ static BOOL isUnsafeMessage(int msgid); errorString:errstr]; ASLogDebug(@"eval(%@)=%@", expr, eval); } @catch (NSException *ex) { - ASLogWarn(@"Exception caught: %@", ex); + ASLogNotice(@"evaluateExpressionCocoa: failed: pid=%d id=%d reason=%@", + pid, identifier, ex); *errstr = [ex reason]; } @@ -464,7 +469,7 @@ static BOOL isUnsafeMessage(int msgid); [windowController processInputQueueDidFinish]; } @catch (NSException *ex) { - ASLogWarn(@"Caught exception (pid=%d): %@", pid, ex); + ASLogNotice(@"Exception: pid=%d id=%d reason=%@", pid, identifier, ex); } } @@ -856,8 +861,8 @@ static BOOL isUnsafeMessage(int msgid); [[NSDocumentController sharedDocumentController] noteNewRecentFilePath:path]; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"Exception: pid=%d id=%d reason=%@", pid, identifier, ex); } @finally { [conn setRequestTimeout:oldTimeout]; @@ -889,8 +894,9 @@ static BOOL isUnsafeMessage(int msgid); @try { [backendProxy setDialogReturn:ret]; } - @catch (NSException *e) { - ASLogWarn(@"Exception caught: %@", e); + @catch (NSException *ex) { + ASLogNotice(@"setDialogReturn: failed: pid=%d id=%d reason=%@", + pid, identifier, ex); } } @@ -1272,6 +1278,8 @@ static BOOL isUnsafeMessage(int msgid); - (void)scheduleClose { + ASLogDebug(@"pid=%d id=%d", pid, identifier); + // NOTE! This message can arrive at pretty much anytime, e.g. while // the run loop is the 'event tracking' mode. This means that Cocoa may // well be in the middle of processing some message while this message is diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 251595f34d..b6e79f56bf 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -998,8 +998,9 @@ @try { reply = [backendProxy starRegisterToPasteboard:pb]; } - @catch (NSException *e) { - ASLogWarn(@"Caught exception: \"%@\"", e); + @catch (NSException *ex) { + ASLogNotice(@"starRegisterToPasteboard: failed: pid=%d reason=%@", + [vimController pid], ex); } }