2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 #import "NSObject+ExtendedLogging.h"
28 @implementation NSObject (NGExtendedLogging)
31 static id sharedLogger = nil;
32 if(sharedLogger == nil) {
33 sharedLogger = [[NGLogger alloc] init];
39 return [self sharedLogger];
42 - (void)logDebugWithFormat:(NSString *)_fmt, ... {
47 msg = [[NSString alloc] initWithFormat:_fmt arguments:va];
49 [self logLevel:NGLogLevelDebug withFormat:msg];
53 - (void)logInfoWithFormat:(NSString *)_fmt, ... {
58 msg = [[NSString alloc] initWithFormat:_fmt arguments:va];
60 [self logLevel:NGLogLevelInfo withFormat:msg];
64 - (void)logWarnWithFormat:(NSString *)_fmt, ... {
69 msg = [[NSString alloc] initWithFormat:_fmt arguments:va];
71 [self logLevel:NGLogLevelWarn withFormat:msg];
75 - (void)logErrorWithFormat:(NSString *)_fmt, ... {
80 msg = [[NSString alloc] initWithFormat:_fmt arguments:va];
82 [self logLevel:NGLogLevelError withFormat:msg];
86 - (void)logFatalWithFormat:(NSString *)_fmt, ... {
91 msg = [[NSString alloc] initWithFormat:_fmt arguments:va];
93 [self logLevel:NGLogLevelFatal withFormat:msg];
97 - (void)logLevel:(NGLogLevel)_level withFormat:(NSString *)_fmt, ... {
102 msg = [[NSString alloc] initWithFormat:_fmt arguments:va];
104 [[self logger] logLevel:_level withFormat:msg];
108 - (BOOL)isLogDebugEnabled {
109 return [[self logger] isLogDebugEnabled];
112 - (BOOL)isLogInfoEnabled {
113 return [[self logger] isLogInfoEnabled];
116 - (BOOL)isLogWarnEnabled {
117 return [[self logger] isLogWarnEnabled];
120 - (BOOL)isLogErrorEnabled {
121 return [[self logger] isLogErrorEnabled];
124 - (BOOL)isLogFatalEnabled {
125 return [[self logger] isLogFatalEnabled];