mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Document how to logging in plugins
This commit is contained in:
parent
cd3048d4cf
commit
20067da9f5
1 changed files with 5 additions and 1 deletions
|
|
@ -76,10 +76,14 @@ section.
|
||||||
The only rule to follow for plugins is to define a ``register`` callable, in
|
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::
|
which you map the signals to your plugin logic. Let's take a simple example::
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from pelican import signals
|
from pelican import signals
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
def test(sender):
|
def test(sender):
|
||||||
print("{} initialized !!".format(sender))
|
log.debug("%s initialized !!", sender)
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
signals.initialized.connect(test)
|
signals.initialized.connect(test)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue