Rudiments: /home/dmuse/src/rudiments/include/rudiments/logger.h Source File

Rudiments

- Main Page
- Classes

logger.h
1 // Copyright (c) 2002 David Muse
2 // See the COPYING file for more information.
3
4 #ifndef RUDIMENTS_LOGGER_H
5 #define RUDIMENTS_LOGGER_H
6
7 #include <rudiments/private/loggerincludes.h>
8
11 class RUDIMENTS_DLLSPEC logdestination {
12 #include <rudiments/private/logdestination.h>
13 };
14
15 class syslogdestinationprivate;
16
18 class RUDIMENTS_DLLSPEC syslogdestination : public logdestination {
19 public:
20
22 syslogdestination();
23
26 syslogdestination(const syslogdestination &f);
27
30 syslogdestination &operator=(const syslogdestination &f);
31
33 virtual ~syslogdestination();
34
38 void open(const char *ident, int32_t option,
39 int32_t facility, int32_t priority);
40
42 void close();
43 #include <rudiments/private/syslogdestination.h>
44 };
45
46
47 class filedestinationprivate;
48
50 class RUDIMENTS_DLLSPEC filedestination : public logdestination {
51 public:
52
54 filedestination();
55
58 filedestination(const filedestination &f);
59
62 filedestination &operator=(const filedestination &f);
63
65 virtual ~filedestination();
66
69 bool open(const char *filename, mode_t perms);
70
72 void close();
73 #include <rudiments/private/filedestination.h>
74 };
75
76
78 class RUDIMENTS_DLLSPEC stdoutdestination : public logdestination {
79 #include <rudiments/private/stdoutdestination.h>
80 };
81
82
84 class RUDIMENTS_DLLSPEC stderrdestination : public logdestination {
85 #include <rudiments/private/stderrdestination.h>
86 };
87
88
89 typedef linkedlistnode<logdestination *> loggerlistnode;
90 typedef linkedlist<logdestination *> loggerlist;
91
92 class loggerprivate;
93
103 class RUDIMENTS_DLLSPEC logger {
104 public:
105
107 logger();
108
110 ~logger();
111
114 void addLogDestination(logdestination *logdest);
115
118 void removeLogDestination(logdestination *logdest);
119
122 void removeAllLogDestinations();
123
124
140 static char *logHeader(const char *name);
141
142
145 void write(const char *header, int32_t tabs,
146 const char *string);
147
150 void write(const char *header, int32_t tabs, char character);
151
154 void write(const char *header, int32_t tabs, int32_t number);
155
158 void write(const char *header, int32_t tabs, double number);
159
160 #include <rudiments/private/logger.h>
161 };
162
163 #endif
character
Definition: character.h:11
linkedlist
Definition: linkedlist.h:60
stdoutdestination
Definition: logger.h:78
logdestination
Definition: logger.h:11
logger
Definition: logger.h:103
linkedlistnode
Definition: linkedlist.h:11
syslogdestination
Definition: logger.h:18
stderrdestination
Definition: logger.h:84
filedestination
Definition: logger.h:50