1 /*******************************************************************************
2 
3         copyright:      Copyright (c) 2004 Kris Bell. All rights reserved
4 
5         license:        BSD style: $(LICENSE)
6       
7         version:        Initial release: May 2004
8         
9         author:         Kris
10 
11 *******************************************************************************/
12 
13 module tango.util.log.model.ILogger;
14 
15 /*******************************************************************************
16 
17 *******************************************************************************/
18 
19 interface ILogger
20 {
21         enum Level {Trace=0, Info, Warn, Error, Fatal, None};
22 
23         /***********************************************************************
24         
25                 Is this logger enabed for the specified Level?
26 
27         ***********************************************************************/
28 
29         @property bool enabled (Level level = Level.Fatal);
30 
31         /***********************************************************************
32 
33                 Append a trace message
34 
35         ***********************************************************************/
36 
37         void trace (const(char[]) fmt, ...);
38 
39         /***********************************************************************
40 
41                 Append an info message
42 
43         ***********************************************************************/
44 
45         void info (const(char[]) fmt, ...);
46         
47         /***********************************************************************
48 
49                 Append a warning message
50 
51         ***********************************************************************/
52 
53         void warn (const(char[]) fmt, ...);
54 
55         /***********************************************************************
56 
57                 Append an error message
58 
59         ***********************************************************************/
60 
61         void error (const(char[]) fmt, ...);
62 
63         /***********************************************************************
64 
65                 Append a fatal message
66 
67         ***********************************************************************/
68 
69         void fatal (const(char[]) fmt, ...);
70 
71         /***********************************************************************
72 
73                 Return the name of this ILogger (sans the appended dot).
74        
75         ***********************************************************************/
76 
77         @property const(char)[] name ();
78 
79         /***********************************************************************
80         
81                 Return the Level this logger is set to
82 
83         ***********************************************************************/
84 
85         @property Level level ();
86 
87         /***********************************************************************
88         
89                 Set the current level for this logger (and only this logger).
90 
91         ***********************************************************************/
92 
93         @property ILogger level (Level l);
94 
95         /***********************************************************************
96         
97                 Is this logger additive? That is, should we walk ancestors
98                 looking for more appenders?
99 
100         ***********************************************************************/
101 
102         @property bool additive ();
103 
104         /***********************************************************************
105         
106                 Set the additive status of this logger. See isAdditive().
107 
108         ***********************************************************************/
109 
110         @property ILogger additive (bool enabled);
111 
112         /***********************************************************************
113         
114                 Send a message to this logger via its appender list.
115 
116         ***********************************************************************/
117 
118         ILogger append (Level level, lazy const(char[]) exp);
119 }