From 4c5e850b49753cbed3a9a52f1fb5d5e5caaa8aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 21 May 2016 08:50:13 +0300 Subject: Use log.warning instead of deprecated log.warn in example code --- systemd/journal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemd/journal.py b/systemd/journal.py index fae7f6f..4efb8a4 100644 --- a/systemd/journal.py +++ b/systemd/journal.py @@ -458,7 +458,7 @@ class JournalHandler(_logging.Handler): >>> log = logging.getLogger('custom_logger_name') >>> log.propagate = False >>> log.addHandler(JournalHandler()) - >>> log.warn("Some message: %s", 'detail') + >>> log.warning("Some message: %s", 'detail') Note that by default, message levels `INFO` and `DEBUG` are ignored by the logging framework. To enable those log levels: @@ -479,7 +479,7 @@ class JournalHandler(_logging.Handler): >>> import uuid >>> mid = uuid.UUID('0123456789ABCDEF0123456789ABCDEF') - >>> log.warn("Message with ID", extra={'MESSAGE_ID': mid}) + >>> log.warning("Message with ID", extra={'MESSAGE_ID': mid}) Fields to be attached to all messages sent through this handler can be specified as keyword arguments. This probably makes sense -- cgit v1.2.1