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;
169 void open(
const char *ident, Class grp = classUser);
177 Slog &operator()(
const char *ident, Class grp = classUser,
178 Level level = levelError);
185 Slog &operator()(Level level, Class grp = classDefault);
190 Slog &operator()(
void);
197 void error(
const char *format, ...);
204 void warn(
const char *format, ...);
211 void debug(
const char *format, ...);
218 void emerg(
const char *format, ...);
225 void alert(
const char *format, ...);
232 void critical(
const char *format, ...);
239 void notice(
const char *format, ...);
246 void info(
const char *format, ...);
263 inline Slog &warn(
void)
264 {
return operator()(Slog::levelWarning);}
266 inline Slog &error(
void)
267 {
return operator()(Slog::levelError);}
269 inline Slog &debug(
void)
270 {
return operator()(Slog::levelDebug);}
272 inline Slog &emerg(
void)
273 {
return operator()(Slog::levelEmergency);}
275 inline Slog &alert(
void)
276 {
return operator()(Slog::levelAlert);}
278 inline Slog &critical(
void)
279 {
return operator()(Slog::levelCritical);}
281 inline Slog ¬ice(
void)
282 {
return operator()(Slog::levelNotice);}
284 inline Slog &info(
void)
285 {
return operator()(Slog::levelInfo);}
289 extern __EXPORT Slog slog;
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...
The slog class is used to stream messages to the system's logging facility (syslogd).
Common C++ generic string class.
void lock(ExclusiveAccess &object)
Convenience function to exclusively lock an object through it's protocol.
Common C++ thread class and sychronization objects.