Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging #216

Open
Gjum opened this issue Feb 19, 2016 · 0 comments
Open

Logging #216

Gjum opened this issue Feb 19, 2016 · 0 comments

Comments

@Gjum
Copy link
Member

Gjum commented Feb 19, 2016

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.

@Gjum Gjum self-assigned this Feb 19, 2016
@Gjum Gjum removed their assignment Jul 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant