Skip to content

Commit 4c5e850

Browse files
committed
Use log.warning instead of deprecated log.warn in example code
1 parent 947f782 commit 4c5e850

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

systemd/journal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ class JournalHandler(_logging.Handler):
458458
>>> log = logging.getLogger('custom_logger_name')
459459
>>> log.propagate = False
460460
>>> log.addHandler(JournalHandler())
461-
>>> log.warn("Some message: %s", 'detail')
461+
>>> log.warning("Some message: %s", 'detail')
462462
463463
Note that by default, message levels `INFO` and `DEBUG` are
464464
ignored by the logging framework. To enable those log levels:
@@ -479,7 +479,7 @@ class JournalHandler(_logging.Handler):
479479
480480
>>> import uuid
481481
>>> mid = uuid.UUID('0123456789ABCDEF0123456789ABCDEF')
482-
>>> log.warn("Message with ID", extra={'MESSAGE_ID': mid})
482+
>>> log.warning("Message with ID", extra={'MESSAGE_ID': mid})
483483
484484
Fields to be attached to all messages sent through this handler
485485
can be specified as keyword arguments. This probably makes sense

0 commit comments

Comments
 (0)