2 Copyright (C) 2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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
22 #ifndef __NGExtensions_NGLoggerManager_H_
23 #define __NGExtensions_NGLoggerManager_H_
28 Manages a set of loggers by associating logger instances with names. Thus
29 clients will be given the same instances if accessing the manager with the
30 same name/key. Also, NGLoggerManager offers conditional creation of loggers
31 based on user default keys (and special values associated with these keys).
33 It's planned that NGLoggerManager will be provided with a configuration of
34 some sort at a later stage, so configuration of log levels and appenders for
35 loggers can reach a similar dynamism as is currently achieved in Log4J.
38 #import <Foundation/NSObject.h>
40 @class NSString, NSMutableDictionary;
43 @interface NGLoggerManager : NSObject
45 NSMutableDictionary *loggerMap;
48 + (id)defaultLoggerManager;
50 /* Retrieves a logger conditional to the existence of the given default key.
51 In order to stay backwards compatible to existing applications, a boolean
52 value auf YES associated with this key sets the default log level of this
53 logger to NGLogLevelDebug. If the requested default key is not set, *nil* is
56 - (NGLogger *)loggerForDefaultKey:(NSString *)_defaultKey;
58 /* Retrieves a "named" logger with NGLogLevelAll. */
59 - (NGLogger *)loggerForFacilityNamed:(NSString *)_name;
60 - (NGLogger *)loggerForClass:(Class)_clazz;
64 #endif /* __NGExtensions_NGLoggerManager_H_ */