summaryrefslogtreecommitdiff
path: root/systemd/journal.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-03-19 12:59:51 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-03-19 13:28:15 -0400
commit84371c2cfda49483f6dabc6bb85cb0131df1053e (patch)
tree09f7ee7bcc87810cbdb1aaf178f147593ddf8cef /systemd/journal.py
parent5498ad7513e1a703e7881b28c78a47ffd8810838 (diff)
downloadpython-systemd-84371c2cfda49483f6dabc6bb85cb0131df1053e.tar.gz
journal: rename SENDER_FUNCTION to sender_function
Let's not try to make it look like a journal field. It should be a normal parameter. Followup for dce0a855c3281e7051b1cbe0f73386d1c90ef320.
Diffstat (limited to 'systemd/journal.py')
-rw-r--r--systemd/journal.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/systemd/journal.py b/systemd/journal.py
index 39e87ec..e23e5a5 100644
--- a/systemd/journal.py
+++ b/systemd/journal.py
@@ -548,9 +548,12 @@ class JournalHandler(_logging.Handler):
`THREAD_NAME`, `CODE_FILE`, `CODE_LINE`, `CODE_FUNC`, `LOGGER` (name as
supplied to getLogger call), `MESSAGE_ID` (optional, see above),
`SYSLOG_IDENTIFIER` (defaults to sys.argv[0]).
+
+ The function used to actually send messages can be overridden using
+ the `sender_function` parameter.
"""
- def __init__(self, level=_logging.NOTSET, **kwargs):
+ def __init__(self, level=_logging.NOTSET, sender_function=send, **kwargs):
super(JournalHandler, self).__init__(level)
for name in kwargs:
@@ -559,7 +562,7 @@ class JournalHandler(_logging.Handler):
if 'SYSLOG_IDENTIFIER' not in kwargs:
kwargs['SYSLOG_IDENTIFIER'] = _sys.argv[0]
- self.send = kwargs.pop('SENDER_FUNCTION', send)
+ self.send = sender_function
self._extra = kwargs
def emit(self, record):