Greenbone Vulnerability Management Libraries 22.18.1
logging_domain.h File Reference

Implementation of logging domain handling. More...

#include <glib.h>

Go to the source code of this file.

Typedefs

typedef struct gvm_logging_domain gvm_logging_domain_t
 

Functions

gvm_logging_domain_tgvm_logging_domain_new (gchar *log_domain)
 Function to initialize logging instance.
 
void gvm_logging_domain_free (gvm_logging_domain_t *log_domain)
 Frees the resources associated with the given logging domain.
 
gchar * gvm_logging_domain_get_log_domain (gvm_logging_domain_t *log_domain)
 
gchar * gvm_logging_domain_get_log_file (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_log_file (gvm_logging_domain_t *log_domain, gchar *log_file)
 Sets the log file for the logging domain.
 
gchar * gvm_logging_domain_get_prepend_string (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_prepend_string (gvm_logging_domain_t *log_domain, gchar *prepend_string)
 Sets the preprend string for the logging domain.
 
gchar * gvm_logging_domain_get_prepend_time_format (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_prepend_time_format (gvm_logging_domain_t *log_domain, gchar *prepend_time_format)
 Sets the prepend time format for the logging domain.
 
GLogLevelFlags * gvm_logging_domain_get_default_level (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_default_level (gvm_logging_domain_t *log_domain, GLogLevelFlags default_level)
 Sets the default log level for the logging domain.
 
gchar * gvm_logging_domain_get_syslog_facility (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_syslog_facility (gvm_logging_domain_t *log_domain, gchar *syslog_facility)
 Sets the syslog facility for the logging domain.
 
gchar * gvm_logging_domain_get_syslog_ident (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_syslog_ident (gvm_logging_domain_t *log_domain, gchar *syslog_ident)
 Sets the syslog ident for the logging domain.
 
gchar * gvm_logging_domain_get_prepend_separator (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_prepend_separator (gvm_logging_domain_t *log_domain, gchar *prepend_separator)
 Sets the prepend separator for the logging domain.
 
GIOChannel * gvm_logging_domain_get_log_channel (gvm_logging_domain_t *log_domain)
 
void gvm_logging_domain_set_log_channel (gvm_logging_domain_t *log_domain, GIOChannel *log_channel)
 Sets the log channel for the logging domain.
 

Detailed Description

Implementation of logging domain handling.

Typedef Documentation

◆ gvm_logging_domain_t

Function Documentation

◆ gvm_logging_domain_free()

void gvm_logging_domain_free ( gvm_logging_domain_t * log_domain)

Frees the resources associated with the given logging domain.

Frees the resources associated with the given logging domain. This function should be called when the logging domain is no longer needed to ensure that all allocated resources are properly released.

Parameters
log_domainA pointer to a gvm_logging_t structure representing the logging domain to be freed.

◆ gvm_logging_domain_get_default_level()

GLogLevelFlags * gvm_logging_domain_get_default_level ( gvm_logging_domain_t * log_domain)

Retrieves the default log level associated with the given logging domain.

The returned default log level is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The default log level associated with the logging domain or NULL

◆ gvm_logging_domain_get_log_channel()

GIOChannel * gvm_logging_domain_get_log_channel ( gvm_logging_domain_t * log_domain)

Retrieves the log channel associated with the given logging domain.

The returned log channel is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The log channel associated with the logging domain or NULL

◆ gvm_logging_domain_get_log_domain()

gchar * gvm_logging_domain_get_log_domain ( gvm_logging_domain_t * log_domain)

Retrieves the log domain associated with the given logging domain.

The returned log domain is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The log domain associated with the logging domain or NULL

◆ gvm_logging_domain_get_log_file()

gchar * gvm_logging_domain_get_log_file ( gvm_logging_domain_t * log_domain)

Retrieves the log file associated with the given logging domain.

The returned log file is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The log file associated with the logging domain or NULL

◆ gvm_logging_domain_get_prepend_separator()

gchar * gvm_logging_domain_get_prepend_separator ( gvm_logging_domain_t * log_domain)

Retrieves the prepend separator associated with the given logging domain.

The returned prepend separator is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The prepend separator associated with the logging domain or NULL

◆ gvm_logging_domain_get_prepend_string()

gchar * gvm_logging_domain_get_prepend_string ( gvm_logging_domain_t * log_domain)

Retrieves the prepend string associated with the given logging domain.

The returned prepend string is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The prepend string associated with the logging domain or NULL

◆ gvm_logging_domain_get_prepend_time_format()

gchar * gvm_logging_domain_get_prepend_time_format ( gvm_logging_domain_t * log_domain)

Retrieves the prepend time format associated with the given logging domain.

The returned prepend time format is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The prepend time format associated with the logging domain or NULL

◆ gvm_logging_domain_get_syslog_facility()

gchar * gvm_logging_domain_get_syslog_facility ( gvm_logging_domain_t * log_domain)

Retrieves the syslog facility associated with the given logging domain.

The returned syslog facility is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The syslog facility associated with the logging domain or NULL

◆ gvm_logging_domain_get_syslog_ident()

gchar * gvm_logging_domain_get_syslog_ident ( gvm_logging_domain_t * log_domain)

Retrieves the syslog ident associated with the given logging domain.

The returned syslog ident is still owned by the logging domain and should not be freed by the caller.

Parameters
log_domainA pointer to a gvm_logging_domain_t structure.
Returns
The syslog ident associated with the logging domain or NULL

◆ gvm_logging_domain_new()

gvm_logging_domain_t * gvm_logging_domain_new ( gchar * log_domain)

Function to initialize logging instance.

This function is responsible for setting up the logging mechanism and returning a pointer to the logging struct. It ensures that the logging struct is properly configured before use.

Parameters
log_domainA string containing the log domain to be used. Gets owned by the logging domain and must not be freed.
Returns
gvm_logging_t* Pointer to the new logging struct.

◆ gvm_logging_domain_set_default_level()

void gvm_logging_domain_set_default_level ( gvm_logging_domain_t * log_domain,
GLogLevelFlags default_level )

Sets the default log level for the logging domain.

This function sets the default log level for the specified logging domain.

Parameters
log_domainThe logging domain for which the default log level is to be set.
default_levelThe default log level to set.

◆ gvm_logging_domain_set_log_channel()

void gvm_logging_domain_set_log_channel ( gvm_logging_domain_t * log_domain,
GIOChannel * log_channel )

Sets the log channel for the logging domain.

This function sets the log channel for the specified logging domain.

Parameters
log_domainThe logging domain for which the log channel is to be set.
log_channelThe log channel to set. Gets referenced by the logging and unreferenced when the logging domain is freed.

◆ gvm_logging_domain_set_log_file()

void gvm_logging_domain_set_log_file ( gvm_logging_domain_t * log_domain,
gchar * log_file )

Sets the log file for the logging domain.

This function sets the file to which log messages for the specified logging domain will be written.

Parameters
log_domainThe logging domain for which the log file is to be set.
log_fileThe path to the log file. Gets owned by the logging domain and must not be freed.

◆ gvm_logging_domain_set_prepend_separator()

void gvm_logging_domain_set_prepend_separator ( gvm_logging_domain_t * log_domain,
gchar * prepend_separator )

Sets the prepend separator for the logging domain.

This function sets the prepend separator for the specified logging domain.

Parameters
log_domainThe logging domain for which the prepend separator is to be set.
prepend_separatorThe prepend separator to set. Gets owned by the logging domain and must not be freed.

◆ gvm_logging_domain_set_prepend_string()

void gvm_logging_domain_set_prepend_string ( gvm_logging_domain_t * log_domain,
gchar * prepend_string )

Sets the preprend string for the logging domain.

This function sets the string that will be prepended to every log message

Parameters
log_domainThe logging domain for which the prepend string is to be set.
prepend_stringThe string to prepend. Gets owned by the logging domain and must not be freed.

◆ gvm_logging_domain_set_prepend_time_format()

void gvm_logging_domain_set_prepend_time_format ( gvm_logging_domain_t * log_domain,
gchar * prepend_time_format )

Sets the prepend time format for the logging domain.

This function sets the time format that will be used when t is present in the prepend string.

Parameters
log_domainThe logging domain for which the prepend time format is to be set.
prepend_time_formatThe time format to set. Gets owned by the logging domain and must not be freed.

◆ gvm_logging_domain_set_syslog_facility()

void gvm_logging_domain_set_syslog_facility ( gvm_logging_domain_t * log_domain,
gchar * syslog_facility )

Sets the syslog facility for the logging domain.

This function sets the syslog facility for the specified logging domain.

Parameters
log_domainThe logging domain for which the syslog facility is to be set.
syslog_facilityThe syslog facility to set. Gets owned by the logging domain and must not be freed.

◆ gvm_logging_domain_set_syslog_ident()

void gvm_logging_domain_set_syslog_ident ( gvm_logging_domain_t * log_domain,
gchar * syslog_ident )

Sets the syslog ident for the logging domain.

This function sets the syslog ident for the specified logging domain.

Parameters
log_domainThe logging domain for which the syslog ident is to be set.
syslog_identThe syslog ident to set. Gets owned by the logging domain and must not be freed.