|
qlog_t * | qlog (const char *filepathfmt, mode_t mode, int rotateinterval, int options) |
| Open ratating-log file. More...
|
|
static bool | write_ (qlog_t *log, const char *str) |
| qlog->write(): Log messages More...
|
|
static bool | writef (qlog_t *log, const char *format,...) |
| qlog->writef(): Log messages More...
|
|
static bool | duplicate (qlog_t *log, FILE *outfp, bool flush) |
| qlog->duplicate(): Duplicate log string into other stream More...
|
|
static bool | flush_ (qlog_t *log) |
| qlog->flush(): Flush buffered log More...
|
|
static void | free_ (qlog_t *log) |
| qlog->free(): Close ratating-log file & de-allocate resources More...
|
|
Rotating file logger object.
qlog implements a auto-rotating file logger.
qlog_t *log =
qlog(
"/tmp/dailylog-%Y%m%d.err", 0644, 86400,
false);
if(log == NULL) return;
log->duplicate(log, stdout, true);
log->write(log, "Service started.");
log->writef(log, "Server Id: %d", 1);
log->free(log);
Definition in file qlog.c.