File: logging.rst

package info (click to toggle)
errbot 6.2.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,796 kB
  • sloc: python: 11,557; makefile: 164; sh: 97
file content (17 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Logging
-------

Logging information on what your plugin is doing can be a tremendous asset when managing
your bot in production, especially when something is going wrong.

Errbot uses the standard Python `logging <https://docs.python.org/3/library/logging.html>`_
library to log messages internally and provides a logger for your own plugins to use as well as `self.log`.
You can use this logger to log status messages to the log like this:

.. code-block:: python

    from errbot import BotPlugin

    class PluginExample(BotPlugin):
        def callback_message(self, message):
            self.log.info("I just received a message!")