OpenVAS Libraries
4.0+rc3.SVN
|
Implementation of logging methods for OpenVAS. More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <syslog.h>
#include <unistd.h>
#include <libgen.h>
#include <errno.h>
#include "openvas_logging.h"
Data Structures | |
struct | openvas_logging_t |
Functions | |
gchar * | get_time (gchar *time_fmt) |
Returns time as specified in time_fmt strftime format. | |
GSList * | load_log_configuration (gchar *config_file) |
Loads parameters from a config file into a linked list. | |
void | free_log_configuration (GSList *log_domain_list) |
Frees all resources loaded by the config loader. | |
void | openvas_log_silent (const char *log_domain, GLogLevelFlags log_level, const char *message, gpointer openvas_log_config_list) |
Returns immediately. | |
void | openvas_log_func (const char *log_domain, GLogLevelFlags log_level, const char *message, gpointer openvas_log_config_list) |
Creates the formatted string and outputs it to the log destination. | |
void | setup_log_handlers (GSList *openvas_log_config_list) |
Sets up routing of logdomains to log handlers. |
Implementation of logging methods for OpenVAS.
This file contains all methods needed for openvas logging. To enable logging, methods in this file are called. Have a look at openvas-server/openvassd/openvassd.c for an example.
The module reuses glib datatypes and api for memory management and logging.
void free_log_configuration | ( | GSList * | log_domain_list | ) |
Frees all resources loaded by the config loader.
log_domain_list | Head of the link list. |
gchar* get_time | ( | gchar * | time_fmt | ) |
Returns time as specified in time_fmt strftime format.
time_fmt | ptr to the string format to use. The strftime man page documents the conversion specification. An example time_fmt string is "%Y-%m-%d %H:%M:%S". |
GSList* load_log_configuration | ( | gchar * | config_file | ) |
Loads parameters from a config file into a linked list.
config_file | A string containing the path to the configuration file to load. |
void openvas_log_func | ( | const char * | log_domain, |
GLogLevelFlags | log_level, | ||
const char * | message, | ||
gpointer | openvas_log_config_list | ||
) |
Creates the formatted string and outputs it to the log destination.
log_domain | A string containing the message's log domain. |
log_level | Flags defining the message's log level. |
message | A string containing the log message. |
openvas_log_config_list | A pointer to the configuration linked list. |
void openvas_log_silent | ( | const char * | log_domain, |
GLogLevelFlags | log_level, | ||
const char * | message, | ||
gpointer | openvas_log_config_list | ||
) |
Returns immediately.
log_domain | A string containing the message's log domain. |
log_level | Flags defining the message's log level. |
message | A string containing the log message. |
openvas_log_config_list | A pointer to the configuration linked list. |
void setup_log_handlers | ( | GSList * | openvas_log_config_list | ) |
Sets up routing of logdomains to log handlers.
Iterates over the link list and adds the groups to the handler.
openvas_log_config_list | A pointer to the configuration linked list. |