|
From: <mic...@us...> - 2003-09-09 01:31:37
|
Update of /cvsroot/log4cocoa/log4cocoa
In directory sc8-pr-cvs1:/tmp/cvs-serv12277
Modified Files:
L4SimpleLayout.m
Log Message:
This is unrelated to the variadic macros. I revised -format: to be faster and (I think) clearer.
Index: L4SimpleLayout.m
===================================================================
RCS file: /cvsroot/log4cocoa/log4cocoa/L4SimpleLayout.m,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- L4SimpleLayout.m 15 Jun 2003 03:19:21 -0000 1.3
+++ L4SimpleLayout.m 8 Sep 2003 19:15:05 -0000 1.4
@@ -39,34 +39,13 @@
- (NSString *) format: (L4LoggingEvent *) anEvent
{
- NSString *message;
-
- message = [[[anEvent level] stringValue] stringByAppendingString: @" - "];
- message = [message stringByAppendingString: [[NSNumber numberWithLong: [anEvent millisSinceStart]] stringValue]];
-
-// message = [[[message stringByAppendingString: @" - "] stringByAppendingString: [[anEvent logger] name]] stringByAppendingString: @" ("];
-
- if( [anEvent fileName] != nil )
- {
- message = [message stringByAppendingString: [anEvent fileName]];
- }
-
- message = [message stringByAppendingString: @":"];
-
- if( [anEvent lineNumber] != nil )
- {
- message = [message stringByAppendingString: [[anEvent lineNumber] stringValue]];
- }
-
- message = [message stringByAppendingString: @") "];
-
- if( [anEvent methodName] != nil ) {
- message = [message stringByAppendingString: [anEvent methodName]];
- }
-
- message = [[message stringByAppendingString: @" - "] stringByAppendingString: [anEvent renderedMessage]];
-
- return message;
+ return [NSString stringWithFormat:@"%@ - %ld %@:%@) %@ - %@",
+ [[anEvent level] stringValue],
+ [anEvent millisSinceStart],
+ [anEvent fileName] ?: @"",
+ [[anEvent lineNumber] stringValue] ?: @"",
+ [anEvent methodName] ?: @"",
+ [anEvent renderedMessage]];
}
- (BOOL) ignoresException
|