]> err.no Git - sope/blob - sope-core/NGExtensions/NGExtensions/NGLogAppender.h
Drop apache 1 build-dependency
[sope] / sope-core / NGExtensions / NGExtensions / NGLogAppender.h
1 /*
2   Copyright (C) 2004-2005 SKYRIX Software AG
3
4   This file is part of SOPE.
5
6   SOPE 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   SOPE 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 SOPE; 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_NGLogAppender_H_
23 #define __NGExtensions_NGLogAppender_H_
24
25 /*
26   NGLogAppender
27
28   Abstract superclass for all log appenders.
29
30   NGLogAppender honours the following user default keys:
31  
32   User Default key              Function
33   ----------------------------------------------------------------------------
34   NGLogDefaultAppenderClass     The appender class to use if no class
35                                 information was provided by the configuration.
36                                 The fallback is "NGLogStdoutAppender".
37  
38  
39   The following keys in the configuration dictionary will be recognized:
40  
41   Key                           Function
42   ----------------------------------------------------------------------------
43   "Class"                       The class to use for instance creation. If no
44                                 class name is provided, the fallback path
45                                 described above will be taken.
46
47   "Formatter"                   Dictionary suitable as configuration
48                                 provided to NGLogEventFormatters's factory
49                                 method. Please see NGLogEventFormatteer.h for
50                                 further explanation.
51 */
52
53 #import <Foundation/NSObject.h>
54 #include <NGExtensions/NGLogLevel.h>
55
56 @class NSDictionary, NGLogEvent, NGLogEventFormatter;
57
58 @interface NGLogAppender : NSObject
59 {
60   NGLogEventFormatter *formatter;
61 }
62
63 /* factory method */
64 + (id)logAppenderFromConfig:(NSDictionary *)_config;
65
66 /* designated initializer */
67 - (id)initWithConfig:(NSDictionary *)_config;
68
69 /* subclass responsibility */
70 - (void)appendLogEvent:(NGLogEvent *)_event;
71 - (NSString *)formattedEvent:(NGLogEvent *)_event;
72
73 @end
74
75 #endif  /* __NGExtensions_NGLogAppender_H_ */