Buffered logging. More...
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "log.h"
#include "debug.h"
#include "utils.h"
#include "loggers/logger.h"
Data Structures | |
struct | janus_log_buffer |
Macros | |
#define | THREAD_NAME "log" |
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, GHashTable *loggers) |
Log initialization. | |
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. Each time there's stuff to be written (to stdout, log files, or external loggers), it's added to an async queue, which is consumed from a dedicated thread that then actually takes care of I/O.
#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, | ||
GHashTable * | loggers ) |
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 |
loggers | Hash table of external loggers registered in the core, 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_vprintf | ( | const char * | format, |
... ) |