#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include "fg_log.h"
#include "fg_time.h"
#include "fg_error.h"
Go to the source code of this file.
◆ close_logging()
void close_logging |
( |
void |
| ) |
|
Close logging stream.
Definition at line 57 of file fg_log.c.
◆ init_logging()
Open logging stream.
- Parameters
-
[in] | stream | to which output stream we log |
Definition at line 43 of file fg_log.c.
49 openlog(
"flowgrindd", LOG_NDELAY | LOG_CONS | LOG_PID, LOG_DAEMON);
◆ logging()
void logging |
( |
int |
priority, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ vlogging()
void vlogging |
( |
int |
priority, |
|
|
const char * |
fmt, |
|
|
va_list |
ap |
|
) |
| |
Definition at line 78 of file fg_log.c.
80 char timestamp[30] =
"";
81 ctimenow_r(timestamp,
sizeof(timestamp),
false);
85 vsyslog(priority, fmt, ap);
88 fprintf(stderr,
"%s ", timestamp);
89 vfprintf(stderr, fmt, ap);
90 fprintf(stderr,
"\n");
94 fprintf(stdout,
"%s ", timestamp);
95 vfprintf(stdout, fmt, ap);
96 fprintf(stdout,
"\n");
◆ log_stream