Skip to content

Importing anything from circus ruins logging config for applications. #1234

Description

@JC3

This isn't cool:

logging.basicConfig()

Please don't call logging.basicConfig(), especially from a library, and especially as an import side-effect...

This requires any application that uses logging.basicConfig() to be modified to include force=True in order for an application's logging system to work. Not a hard fix, just super annoying (and was hard to track down, too, given that importing circus makes applications that rely on logging output look like they aren't running at all, by producing no logging output). It interferes even more with logging in applications that don't intend to call basicConfig().

Really, it's kind of weird that this has been sitting there for 13 years since 02fdb97 (and, ironically, the version prior to that commit was more appropriate).

The logging.basicConfig() calls should be moved back into the mains for circus' tools.

Note that the "no handlers could be found for logger" error that this was intended to solve has not really been applicable since Python 3.2, where a default fallback logging handler was added to logging, thus avoiding this error entirely for unconfigured loggers.

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