Rudiments
logger.h
1// Copyright (c) 1999-2018 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
11class RUDIMENTS_DLLSPEC logdestination : virtual public object {
12 #include <rudiments/private/logdestination.h>
13};
14
16class RUDIMENTS_DLLSPEC syslogdestination : public logdestination {
17 public:
18
21
24
28 void open(const char *ident, int32_t option,
29 int32_t facility, int32_t priority);
30
32 void close();
33
34 #include <rudiments/private/syslogdestination.h>
35};
36
37
39class RUDIMENTS_DLLSPEC filedestination : public logdestination {
40 public:
41
44
47
50 bool open(const char *filename, mode_t perms);
51
53 void close();
54
55 #include <rudiments/private/filedestination.h>
56};
57
58
60class RUDIMENTS_DLLSPEC stdoutdestination : public logdestination {
61 #include <rudiments/private/stdoutdestination.h>
62};
63
64
66class RUDIMENTS_DLLSPEC stderrdestination : public logdestination {
67 #include <rudiments/private/stderrdestination.h>
68};
69
70
73
83class RUDIMENTS_DLLSPEC logger : public object {
84 public:
85
88
91
95
99
103
104
106 void setIndent(char ch);
107
109 char getIndent();
110
113 void setWideIndent(wchar_t ch);
114
117
118
120 void setLogLevel(uint8_t level);
121
123 uint8_t getLogLevel();
124
125
141 static char *getLogHeader(const char *name);
142
158 static wchar_t *getLogHeader(const wchar_t *name);
159
160
165 void start(uint8_t level,
166 const char *header,
167 uint32_t indent,
168 const char *string);
169
174 void start(uint8_t level,
175 const wchar_t *header,
176 uint32_t indent,
177 const wchar_t *string);
178
183 void write(uint8_t level,
184 const char *header,
185 uint32_t indent,
186 const char *format, ...);
187
192 void write(uint8_t level,
193 const wchar_t *header,
194 uint32_t indent,
195 const wchar_t *format, ...);
196
201 void write(uint8_t level,
202 const char *header,
203 uint32_t indent,
204 const char *format,
205 va_list *argp);
206
211 void write(uint8_t level,
212 const wchar_t *header,
213 uint32_t indent,
214 const wchar_t *format,
215 va_list *argp);
216
220 void end(uint8_t level,
221 const char *header,
222 uint32_t indent);
223
227 void end(uint8_t level,
228 const wchar_t *header,
229 uint32_t indent);
230
231 #include <rudiments/private/logger.h>
232};
233
234#endif
Definition logger.h:39
virtual ~filedestination()
bool open(const char *filename, mode_t perms)
Definition linkedlist.h:47
Definition listcollection.h:12
Definition logger.h:11
Definition logger.h:83
void end(uint8_t level, const wchar_t *header, uint32_t indent)
char getWideIndent()
void removeAllLogDestinations()
static char * getLogHeader(const char *name)
void write(uint8_t level, const wchar_t *header, uint32_t indent, const wchar_t *format, va_list *argp)
void setWideIndent(wchar_t ch)
static wchar_t * getLogHeader(const wchar_t *name)
void setIndent(char ch)
void start(uint8_t level, const wchar_t *header, uint32_t indent, const wchar_t *string)
void addLogDestination(logdestination *logdest)
void write(uint8_t level, const wchar_t *header, uint32_t indent, const wchar_t *format,...)
void end(uint8_t level, const char *header, uint32_t indent)
void write(uint8_t level, const char *header, uint32_t indent, const char *format, va_list *argp)
uint8_t getLogLevel()
void setLogLevel(uint8_t level)
void removeLogDestination(logdestination *logdest)
char getIndent()
void start(uint8_t level, const char *header, uint32_t indent, const char *string)
void write(uint8_t level, const char *header, uint32_t indent, const char *format,...)
Definition object.h:10
Definition logger.h:66
Definition logger.h:60
Definition logger.h:16
void open(const char *ident, int32_t option, int32_t facility, int32_t priority)
virtual ~syslogdestination()