Log interface

Basic logging setup.

rayvision_log.core.get_default_log_config()

Get the default logging configuration.

Returns:The default logging configuration.
Return type:dict
rayvision_log.core.init_logger(app_name)

Initialize logging with our default configuration.

An easier interface for artists to use to create loggers in their packages and applications. Any application that uses this will use the default logging configuration.

Examples

>>> import logging
>>> from rayvision_log import init_logger
>>> app_name = "rayvision_api"
>>> init_logger(app_name)
>>> LOG = logging.getLogger(app_name)
Parameters:app_name (str) – The application or package name for which to create a logger.
rayvision_log.core.set_up_logger(app_name, log_config)

Set up loggers based on given name and configuration.

Example

>>> app_name = "rayvision_api"
>>> log_config = {
                    formatters: {
                        file: {
                            format: '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
                        }
                    },
                    handlers: {
                        file: {
                            class: concurrent_log_handler.ConcurrentRotatingFileHandler
                        }
                    }
                }
Parameters:
  • app_name (str) – Name of the application.
  • log_config (dict) – The configuration of the logger.

References

https://pypi.org/project/ConcurrentLogHandler/

rayvision_log.core.update_config(config)

If python2.7.13 updates file.class

Parameters:config (dict) – logging config
Returns:logging config.
Return type:dict