<commit_before>configlog
=========

Eache to use python logging configuration with sane defaults.


Quick start
-----------

Imperative configuration:

.. code-block:: python

    import configlog

    configlog.defaults('django')
    configlog.set('', 'error', file='%(here)s/logs/errors.log')
    configlog.set('myproject', handler='console', formatter='default')
    configlog.set('myproject.errors', 'error', 'sentry')
    configlog.set('myproject.debug', level='debug', handler='null')

Declarative configuration:

.. code-block:: python

    import configlog

    configlog.configure([
        'defaults=django'
        'level=error file=%(here)s/logs/errors.log',
        'myproject handler=console formatter=default',
        'myproject.errors error sentry',
        'myproject.debug level=debug handler=null',
    ])<commit_msg>Specs for imperative and declarative configuration<commit_after>configlog
=========

Eache to use python logging configuration with sane defaults.


Quick start
-----------

Imperative configuration:

.. code-block:: python

    import configlog

    configlog.defaults('django')
    configlog.set('', 'error', file='%(here)s/logs/errors.log')
    configlog.set('myproject', handler='console', formatter='default')
    configlog.set('myproject.errors', 'error', 'sentry')
    configlog.set('myproject.debug', level='debug', handler='null')
    configlog.configure()

Declarative configuration:

.. code-block:: python

    import configlog

    configlog.configure([
        'defaults=django'
        'level=error file=%(here)s/logs/errors.log',
        'myproject handler=console formatter=default',
        'myproject.errors error sentry',
        'myproject.debug level=debug handler=null',
    ])

Imperative and declarative configurations mixed together:

.. code-block:: python

    import configlog

    (
        configlog.Configurator().
        defaults('django').
        set('', level='error', file='%(here)s/logs/errors.log').
        set('myproject', handler='console', formatter='default').
        configure(
            'myproject.errors error sentry',
            'myproject.debug level=debug handler=null',
        )
    )
{'fraction_non_alphanumeric': 0.15059687786960516, 'fraction_numerical': 0.0, 'mean_word_length': 3.428861788617886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4752786', 'n_tokens_mistral': 623, 'n_tokens_neox': 603, 'n_words': 131}