diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2016-05-21 08:50:13 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2016-05-21 08:50:13 +0300 |
commit | 4c5e850b49753cbed3a9a52f1fb5d5e5caaa8aa3 (patch) | |
tree | 6d587c0a302e9405db171100f7d2ca431efb3a61 | |
parent | 947f78288658aa97128548d32f2d8566b5f26e18 (diff) | |
download | python-systemd-4c5e850b49753cbed3a9a52f1fb5d5e5caaa8aa3.tar.gz |
Use log.warning instead of deprecated log.warn in example code
-rw-r--r-- | systemd/journal.py | 4 |
1 files 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 |