RocketLogger  2.0.0
log.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "log.h"
+ Include dependency graph for log.c:

Go to the source code of this file.

Functions

int rl_log_init (char const *const log_file, rl_log_level_t verbosity)
 
void rl_log_verbosity (rl_log_level_t verbosity)
 
int rl_log (rl_log_level_t log_level, char const *const format,...)
 

Function Documentation

◆ rl_log()

◆ rl_log_init()

int rl_log_init ( char const *const  log_file,
rl_log_level_t  verbosity 
)

Initialize the log module.

Note
This function should be called before the first log message is stored.
Parameters
log_fileThe filename of the file the log messages are written to
verbosityMessages with a log level more severe or equal to this level are also printed to the terminal
Returns
Returns 0 on success, negative on failure with errno set accordingly

Definition at line 49 of file log.c.

References rl_log_verbosity().

Referenced by main().

+ Here is the call graph for this function:

◆ rl_log_verbosity()

void rl_log_verbosity ( rl_log_level_t  verbosity)

Change the log module's verbosity.

Parameters
verbosityMessages with log levels more severe or equal to the verbosity level are also printed to the terminal

Definition at line 80 of file log.c.

Referenced by rl_log_init().