Fork me on GitHub
Loading...
Searching...
No Matches
Functions
log.h File Reference

Buffered logging (headers) More...

#include <stdio.h>
#include <glib.h>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void janus_vprintf (const char *format,...) G_GNUC_PRINTF(1
 Buffered vprintf.
 
void int janus_log_init (gboolean daemon, gboolean console, const char *logfile, GHashTable *loggers)
 Log initialization.
 
void janus_log_destroy (void)
 Log destruction.
 
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.
 

Detailed Description

Buffered logging (headers)

Author
Jay Ridgeway jayri.nosp@m.dge@.nosp@m.gmail.nosp@m..com

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.

Core

Function Documentation

◆ janus_log_destroy()

void janus_log_destroy ( void )

Log destruction.

◆ janus_log_get_logfile_path()

char * janus_log_get_logfile_path ( void )

Method to get the path to the log file.

Returns
The full path to the log file, or NULL otherwise

◆ janus_log_init()

void int janus_log_init ( gboolean daemon,
gboolean console,
const char * logfile,
GHashTable * loggers )

Log initialization.

Note
This should be called before attempting to use the logger. A buffer pool and processing thread are created.
Parameters
daemonWhether the Janus is running as a daemon or not
consoleWhether the output should be printed on stdout or not
logfileLog file to save the output to, if any
loggersHash table of external loggers registered in the core, if any
Returns
0 in case of success, a negative integer otherwise

◆ janus_log_is_logfile_enabled()

gboolean janus_log_is_logfile_enabled ( void )

Method to check whether file-based logging is enabled.

Returns
TRUE if file-based logging is enabled, FALSE otherwise

◆ janus_log_is_stdout_enabled()

gboolean janus_log_is_stdout_enabled ( void )

Method to check whether stdout logging is enabled.

Returns
TRUE if stdout logging is enabled, FALSE otherwise

◆ janus_vprintf()

void janus_vprintf ( const char * format,
... )

Buffered vprintf.

Parameters
[in]formatFormat string as defined by glib, followed by the optional parameters to insert into formatted string (printf style)
Note
This output is buffered and may not appear immediately on stdout.