44 #ifndef COMMONCPP_SLOG_H_
45 #define COMMONCPP_SLOG_H_
49 #ifndef COMMONCPP_CONFIG_H_
50 #include <commoncpp/config.h>
53 #ifndef COMMONCPP_STRING_H_
57 #ifndef COMMONCPP_THREAD_H_
104 class __EXPORT
Slog :
protected std::streambuf,
public std::ostream
135 mutable pthread_mutex_t lock;
150 int overflow(
int c) __OVERRIDE;
171 void open(
const char *ident, Class grp = classUser);
179 Slog &operator()(
const char *ident, Class grp = classUser,
180 Level level = levelError);
187 Slog &operator()(Level level, Class grp = classDefault);
192 Slog &operator()(
void);
199 void error(
const char *format, ...);
206 void warn(
const char *format, ...);
213 void debug(
const char *format, ...);
220 void emerg(
const char *format, ...);
227 void alert(
const char *format, ...);
234 void critical(
const char *format, ...);
241 void notice(
const char *format, ...);
248 void info(
const char *format, ...);
267 inline Slog &warn(
void) {
268 return operator()(Slog::levelWarning);
271 inline Slog &error(
void) {
272 return operator()(Slog::levelError);
275 inline Slog &debug(
void) {
276 return operator()(Slog::levelDebug);
279 inline Slog &emerg(
void) {
280 return operator()(Slog::levelEmergency);
283 inline Slog &alert(
void) {
284 return operator()(Slog::levelAlert);
287 inline Slog &critical(
void) {
288 return operator()(Slog::levelCritical);
291 inline Slog ¬ice(
void) {
292 return operator()(Slog::levelNotice);
295 inline Slog &info(
void) {
296 return operator()(Slog::levelInfo);
301 extern __EXPORT Slog slog;
Common C++ generic string class.
Common C++ thread class and sychronization objects.
The slog class is used to stream messages to the system's logging facility (syslogd).
void level(Level enable)
Sets the logging level.
void clogEnable(bool f=true)
Enables or disables the echoing of the messages to clog in addition to the syslog daemon...