google.cloud.forseti.common.util.logger module

A basic util that wraps logging.

Setup logging for Forseti Security. Logs to console and syslog.

_create_syslog_handler()[source]

Create the syslog handler.

Returns:A configured syslog handler.
Return type:handler
_map_logger(func)[source]

Map function to current loggers.

Parameters:func (function) – Function to call on every logger.
enable_console_log()[source]

Enable console logging for all the new loggers and add console handlers to all the existing loggers.

get_logger(module_name)[source]

Setup the logger.

Parameters:module_name (str) – The name of the mdule to describe the log entry.
Returns:An instance of the configured logger.
Return type:logger
set_logger_level(level)[source]
Modify log level of existing loggers as well as the default
for new loggers.
Parameters:level (int) – The log level to set the loggers to.
set_logger_level_from_config(level_name)[source]

Set the logger level from a config value.

Parameters:level_name (str) – The log level name. The accepted values are in the LOGLEVELS variable.