Skip to content

Logging #216

Description

@Gjum

Many current log messages look like [PLUGINNAME] message or PLUGINNAME: message and some plugins use yet another pattern. This makes it difficult to find out the message source (eg. for grouping messages after the sending plugin).

We should change the logging initialization of our plugins to logger = logging.getLogger(__name__).
This would not change the current logging output, but make it much easier for plugins to post-process logging messages.

The logger name can then be used in a user-defined format string with %(name)s to produce eg. spockbot.plugins.core.net, or accessed from the log record by adding a custom handler.
Even further, by querying the plugin loader the module name can be matched to a plugin name.

Independently, we can also avoid unnecessary processing. If someone really needs that, it can always be turned back on by the user.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions