|
qlog_t * | qlog (const char *filepathfmt, mode_t mode, int rotateinterval, int options) |
| Open ratating-log file.
|
|
static bool | write_ (qlog_t *log, const char *str) |
| qlog->write(): Log messages
|
|
static bool | writef (qlog_t *log, const char *format,...) |
| qlog->writef(): Log messages
|
|
static bool | duplicate (qlog_t *log, FILE *outfp, bool flush) |
| qlog->duplicate(): Duplicate log string into other stream
|
|
static bool | flush_ (qlog_t *log) |
| qlog->flush(): Flush buffered log
|
|
static void | free_ (qlog_t *log) |
| qlog->free(): Close ratating-log file & de-allocate resources
|
|
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);
qlog_t * qlog(const char *filepathfmt, mode_t mode, int rotateinterval, int options)
Open ratating-log file.
Definition in file qlog.c.