43 #ifndef COMMONCPP_SLOG_H_
44 #define COMMONCPP_SLOG_H_
48 #ifndef COMMONCPP_CONFIG_H_
49 #include <commoncpp/config.h>
52 #ifndef COMMONCPP_STRING_H_
56 #ifndef COMMONCPP_THREAD_H_
103 class __EXPORT
Slog :
protected std::streambuf,
public std::ostream
134 mutable pthread_mutex_t
lock;
168 void open(
const char *ident, Class grp = classUser);
176 Slog &operator()(
const char *ident, Class grp = classUser,
177 Level level = levelError);
184 Slog &operator()(Level level, Class grp = classDefault);
189 Slog &operator()(
void);
196 void error(
const char *format, ...);
203 void warn(
const char *format, ...);
210 void debug(
const char *format, ...);
217 void emerg(
const char *format, ...);
224 void alert(
const char *format, ...);
231 void critical(
const char *format, ...);
238 void notice(
const char *format, ...);
245 void info(
const char *format, ...);
262 inline Slog &warn(
void)
263 {
return operator()(Slog::levelWarning);}
265 inline Slog &error(
void)
266 {
return operator()(Slog::levelError);}
268 inline Slog &debug(
void)
269 {
return operator()(Slog::levelDebug);}
271 inline Slog &emerg(
void)
272 {
return operator()(Slog::levelEmergency);}
274 inline Slog &alert(
void)
275 {
return operator()(Slog::levelAlert);}
277 inline Slog &critical(
void)
278 {
return operator()(Slog::levelCritical);}
280 inline Slog ¬ice(
void)
281 {
return operator()(Slog::levelNotice);}
283 inline Slog &info(
void)
284 {
return operator()(Slog::levelInfo);}
288 extern __EXPORT Slog slog;
Common C++ thread class and sychronization objects.
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.