]> err.no Git - sope/blob - sope-core/NGExtensions/NGExtensions/NGLoggerManager.h
cleaned up cookie handling
[sope] / sope-core / NGExtensions / NGExtensions / NGLoggerManager.h
1 /*
2   Copyright (C) 2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21
22 #ifndef __NGExtensions_NGLoggerManager_H_
23 #define __NGExtensions_NGLoggerManager_H_
24
25 /*
26   NGLoggerManager
27
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).
32
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.
36 */
37
38 #import <Foundation/NSObject.h>
39
40 @class NSString, NSMutableDictionary;
41 @class NGLogger;
42
43 @interface NGLoggerManager : NSObject
44 {
45   NSMutableDictionary *loggerMap;
46 }
47
48 + (id)defaultLoggerManager;
49
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
54    returned.
55 */
56 - (NGLogger *)loggerForDefaultKey:(NSString *)_defaultKey;
57
58 /* Retrieves a "named" logger with NGLogLevelAll. */
59 - (NGLogger *)loggerForFacilityNamed:(NSString *)_name;
60 - (NGLogger *)loggerForClass:(Class)_clazz;
61
62 @end
63
64 #endif  /* __NGExtensions_NGLoggerManager_H_ */