|
From: <mic...@us...> - 2003-09-09 05:32:17
|
Update of /cvsroot/log4cocoa/log4cocoa
In directory sc8-pr-cvs1:/tmp/cvs-serv12211
Modified Files:
L4LevelTest.m
Log Message:
There's a simple method here just to exercise the macros. It doesn't actually use ObjcUnit to do any assertions.
Index: L4LevelTest.m
===================================================================
RCS file: /cvsroot/log4cocoa/log4cocoa/L4LevelTest.m,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- L4LevelTest.m 15 Jun 2003 03:16:57 -0000 1.1
+++ L4LevelTest.m 8 Sep 2003 19:14:47 -0000 1.2
@@ -52,4 +52,25 @@
[self assertTrue: [[L4Level levelWithName: @"FATAL"] isEqual: [L4Level fatal]] message: @"FATAL string should yield 'fatal' object"];
}
+- (void) testLogging {
+ [L4Configurator basicConfiguration];
+
+ NSException *e = [[NSException alloc] initWithName:@"TestException" reason:@"Reason" userInfo:nil];
+
+ log4Debug(@"This is a %@ message.", @"DEBUG");
+ log4Info(@"This is an %@ message.", @"INFO");
+ log4Warn(@"This is a %@ message.", @"WARN");
+ log4Error(@"This is a %@ message.", @"ERROR");
+ log4Fatal(@"This is a %@ message.", @"FATAL");
+
+ log4DebugWithException(@"This is a %@ message with an exception.", e, @"DEBUG");
+ log4InfoWithException(@"This is an %@ message with an exception.", e, @"INFO");
+ log4WarnWithException(@"This is a %@ message with an exception.", e, @"WARN");
+ log4ErrorWithException(@"This is a %@ message with an exception.", e, @"ERROR");
+ log4FatalWithException(@"This is a %@ message with an exception.", e, @"FATAL");
+
+ log4Assert(YES, @"This is a %@ assertion.", @"passed");
+ log4Assert(NO, @"This is a %@ assertion.", @"failed");
+}
+
@end
|