diff --git a/README.rst b/README.rst index 56ef1d5..801b4f5 100644 --- a/README.rst +++ b/README.rst @@ -111,6 +111,8 @@ Configured from dictionary 2017-01-31 13:12:56,002 - my_logger - WARNING - This will be written in a file called warning.log +*Note: You can find sample of logging configuration files supported by config-logger in* `this repo`_. + License ------- @@ -121,3 +123,4 @@ This project is licensed under the MIT license. .. _Issue tracker: https://github.com/afxentios/config-logger/issues .. _latest release: https://github.com/afxentios/config-logger/releases .. _Configuration dictionary schema: https://docs.python.org/3/library/logging.config.html#logging-config-dictschema +.. _this repo: https://github.com/afxentios/python_logging_configuration_sample diff --git a/config_logger/logger.py b/config_logger/logger.py index 14d1948..72f122f 100644 --- a/config_logger/logger.py +++ b/config_logger/logger.py @@ -25,6 +25,7 @@ def __init__( name - Name of the Logger instance. cfg_path - Path of the logging configuration file. default_level - Default logging level. + default_conf - Dictionary with the default values for the config files. env_key - Environment variable which can be set to load the logging configuration from specific path. """ diff --git a/setup.py b/setup.py index 4be10d5..dfa5371 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ def readme(): author_email='afxentios@hadjimina.com', keywords=["logging", "configurable", "configuration"], packages=find_packages(), - install_requires=['logging', 'PyYAML', 'config-manager'], + install_requires=['logging', 'PyYAML', 'config-manager', 'testfixtures'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/tests/logger_test.py b/tests/logger_test.py index 3530af9..03d08f5 100644 --- a/tests/logger_test.py +++ b/tests/logger_test.py @@ -94,7 +94,14 @@ class LoggerTest(unittest.TestCase): } } - config2 = {'version': 1, 'disable_existing_loggers': False, 'root': {'level': 'WARNING'}} + config2 = { + 'version': 1, + 'disable_existing_loggers': False, + 'root': + { + 'level': 'WARNING' + } + } @patch.object(ConfigManager, 'load_config') def test_logger_constructor(self, mocked_config):