|
| qlog_t * | qlog (const char *filepathfmt, mode_t mode, int rotateinterval, int options) |
| | Open a rotating 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 output to another stream.
|
| static bool | flush_ (qlog_t *log) |
| | qlog->flush(): Flush buffered log data.
|
| static void | free_ (qlog_t *log) |
| | qlog->free(): Close rotating-log file & free resources
|
Rotating file logger object.
qlog implements an 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 a rotating log file.
Definition in file qlog.c.