Buffered logging. More...
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "log.h"
#include "utils.h"
#include "loggers/logger.h"
Data Structures | |
struct | janus_log_buffer |
Macros | |
#define | THREAD_NAME "log" |
#define | INITIAL_BUFSZ 2000 |
Typedefs | |
typedef struct janus_log_buffer | janus_log_buffer |
Functions | |
gboolean | janus_log_is_stdout_enabled (void) |
Method to check whether stdout logging is enabled. | |
gboolean | janus_log_is_logfile_enabled (void) |
Method to check whether file-based logging is enabled. | |
char * | janus_log_get_logfile_path (void) |
Method to get the path to the log file. | |
void | janus_vprintf (const char *format,...) |
int | janus_log_init (gboolean daemon, gboolean console, const char *logfile) |
Log initialization. | |
void | janus_log_set_loggers (GHashTable *loggers) |
Method to add a list of external loggers to the log management. | |
void | janus_log_destroy (void) |
Log destruction. | |
Buffered logging.
Implementation of a simple buffered logger designed to remove I/O wait from threads that may be sensitive to such delays. Buffers are saved and reused to reduce allocation calls. The logger output can then be printed to stdout and/or a log file. If external loggers are added to the core, the logger output is passed to those as well.
#define INITIAL_BUFSZ 2000 |
#define THREAD_NAME "log" |
typedef struct janus_log_buffer janus_log_buffer |
void janus_log_destroy | ( | void | ) |
Log destruction.
char * janus_log_get_logfile_path | ( | void | ) |
Method to get the path to the log file.
int janus_log_init | ( | gboolean | daemon, |
gboolean | console, | ||
const char * | logfile ) |
Log initialization.
daemon | Whether the Janus is running as a daemon or not |
console | Whether the output should be printed on stdout or not |
logfile | Log file to save the output to, if any |
gboolean janus_log_is_logfile_enabled | ( | void | ) |
Method to check whether file-based logging is enabled.
gboolean janus_log_is_stdout_enabled | ( | void | ) |
Method to check whether stdout logging is enabled.
void janus_log_set_loggers | ( | GHashTable * | loggers | ) |
Method to add a list of external loggers to the log management.
loggers | Hash table of external loggers registered in the core |
void janus_vprintf | ( | const char * | format, |
... ) |