Document how to logging in plugins

This commit is contained in:
Kernc 2020-06-05 14:24:55 +02:00
commit 20067da9f5
No known key found for this signature in database
GPG key ID: E0955D0CB6D501E3

View file

@ -76,10 +76,14 @@ section.
The only rule to follow for plugins is to define a ``register`` callable, in
which you map the signals to your plugin logic. Let's take a simple example::
import logging
from pelican import signals
log = logging.getLogger(__name__)
def test(sender):
print("{} initialized !!".format(sender))
log.debug("%s initialized !!", sender)
def register():
signals.initialized.connect(test)