Debian Codegraph @

docs/user_guide/plugin_development/logging.rst

raw
1 Logging
2 -------
3
4 Logging information on what your plugin is doing can be a tremendous asset when managing
5 your bot in production, especially when something is going wrong.
6
7 Errbot uses the standard Python `logging <https://docs.python.org/3/library/logging.html>`_
8 library to log messages internally and provides a logger for your own plugins to use as well as `self.log`.
9 You can use this logger to log status messages to the log like this:
10
11 .. code-block:: python
12
13 from errbot import BotPlugin
14
15 class PluginExample(BotPlugin):
16 def callback_message(self, message):
17 self.log.info("I just received a message!")