Rudiments
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 
16 class RUDIMENTS_DLLSPEC syslogdestination : public logdestination {
17  public:
18 
21 
25 
28  syslogdestination &operator=(const syslogdestination &f);
29 
31  virtual ~syslogdestination();
32 
36  void open(const char *ident, int32_t option,
37  int32_t facility, int32_t priority);
38 
40  void close();
41  #include <rudiments/private/syslogdestination.h>
42 };
43 
44 
46 class RUDIMENTS_DLLSPEC filedestination : public logdestination {
47  public:
48 
51 
55 
58  filedestination &operator=(const filedestination &f);
59 
61  virtual ~filedestination();
62 
65  bool open(const char *filename, mode_t perms);
66 
68  void close();
69  #include <rudiments/private/filedestination.h>
70 };
71 
72 
74 class RUDIMENTS_DLLSPEC stdoutdestination : public logdestination {
75  #include <rudiments/private/stdoutdestination.h>
76 };
77 
78 
80 class RUDIMENTS_DLLSPEC stderrdestination : public logdestination {
81  #include <rudiments/private/stderrdestination.h>
82 };
83 
84 
87 
97 class RUDIMENTS_DLLSPEC logger {
98  public:
99 
101  logger();
102 
104  ~logger();
105 
108  void addLogDestination(logdestination *logdest);
109 
112  void removeLogDestination(logdestination *logdest);
113 
116  void removeAllLogDestinations();
117 
118 
134  static char *logHeader(const char *name);
135 
136 
139  void write(const char *header, int32_t tabs,
140  const char *string);
141 
144  void write(const char *header, int32_t tabs, char character);
145 
148  void write(const char *header, int32_t tabs, int32_t number);
149 
152  void write(const char *header, int32_t tabs, double number);
153 
154  #include <rudiments/private/logger.h>
155 };
156 
157 #endif
Definition: character.h:11
Definition: linkedlist.h:60
Definition: logger.h:74
Definition: logger.h:11
Definition: logger.h:97
Definition: linkedlist.h:11
Definition: logger.h:16
Definition: logger.h:80
Definition: logger.h:46