From 20067da9f52b56510c3a510b9fe175b60b344543 Mon Sep 17 00:00:00 2001 From: Kernc Date: Fri, 5 Jun 2020 14:24:55 +0200 Subject: [PATCH] Document how to logging in plugins --- docs/plugins.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 76a88507..a4ef91d6 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -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)