40#include <ucommon-config.h>
67streambuf() ,ostream((streambuf *)this)
87pthread_mutex_lock(&
lock);
95 pthread_mutex_unlock(&
lock);
102 pthread_mutex_lock(&
lock);
104 cp = strrchr(ident,
'/');
164 openlog(ident, 0, fac);
169 size_t size = strlen(ident) + 1;
170 char *buf =
new char[size];
172 cp = (
const char *)buf;
173 buf = strrchr(buf,
'.');
181 pthread_mutex_unlock(&
lock);
188 va_start(args, format);
198 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
212 va_start(args, format);
215 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
229 va_start(args, format);
232 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
246 va_start(args, format);
249 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
263 va_start(args, format);
266 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
280 va_start(args, format);
283 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
297 va_start(args, format);
300 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
314 va_start(args, format);
317 vsnprintf(thread->
msgbuf,
sizeof(thread->
msgbuf), format, args);
329 if(c ==
'\n' || !c || c ==
EOF) {
334 pthread_mutex_lock(&
lock);
343 dt = localtime(&now);
345 const char *p =
"unknown";
373 snprintf(buf,
sizeof(buf),
"%04d-%02d-%02d %02d:%02d:%02d [%s] %s\n",
374 dt->tm_year + 1900, dt->tm_mon + 1, dt->tm_mday,
375 dt->tm_hour, dt->tm_min, dt->tm_sec,
382 pthread_mutex_unlock(&
lock);
390 clog << thread->
msgbuf << endl;
The slog class is used to stream messages to the system's logging facility (syslogd).
Slog(void)
Default (and only) constructor.
Slog & operator()(void)
Does nothing except return *this.
void open(const char *ident, Class grp=classUser)
(re)opens the output stream.
int overflow(int c) __OVERRIDE
This is the streambuf function that actually outputs the data to the device.
static Thread * get(void)
void set(const char *text)
Set string object to text of a null terminated string.
Export interfaces for library interfaces.
int stricmp(const char *s1, const char *s2)
System logging facilities abstraction.