Skip to content

unable to instantiate logwood getting AssertionError: A Logger instance has already been created. Cannot call basic_config. error in python #2

Description

@markmark1

In [5]: if 1:
...: import logwood
...: from logwood.handlers.stderr import ColoredStderrHandle
...: r
...: logwood.basic_config(
...: level = logwood.INFO,
...: handlers = [ColoredStderrHandler()]
...: )
...: logger = logwood.get_logger('LoggerName')
...: from aiodebug import log_slow_callbacks
...: log_slow_callbacks.enable(0.05)
...:

AssertionError Traceback (most recent call last)
in
2 import logwood
3 from logwood.handlers.stderr import ColoredStderrHandler
----> 4 logwood.basic_config(
5 level = logwood.INFO,
6 handlers = [ColoredStderrHandler()]

/usr/local/lib/python3.9/site-packages/logwood/init.py in basic_config(handlers, format, level, record_variables)
19 :param record_variables: Additional variables that will be baked into each logged message.
20 '''
---> 21 assert not state.defined_loggers, 'A Logger instance has already been created. Cannot call basic_config.'
22
23 state.config_called = True

AssertionError: A Logger instance has already been created. Cannot call basic_config.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions