[systemd-devel] [RFC PATCH] systemd-python: add SYSLOG_IDENTIFIER to JournalHandler

Steven Hiscocks steven-systemd at hiscocks.me.uk
Mon Apr 22 14:50:33 PDT 2013


On 22/04/13 22:15, Zbigniew Jędrzejewski-Szmek wrote:
> On Mon, Apr 22, 2013 at 09:53:55PM +0100, Steven Hiscocks wrote:
>>> +                self._SYSLOG_IDENTIFIER = (_sys.argv[0]
>>> +                                           if SYSLOG_IDENTIFIER is None
>>> +                                           else SYSLOG_IDENTIFIER)
>>>
>> How about having the value as `__name__`, but`_sys.argv[0]` if
>> `__name__ == "__main__`?
> __name__ would always be 'journal'. We could use __main__.__name__,
> but I don't think it makes much of a difference, since it is set
> from sys.argv[0] anyway. And there's one case where it's less useful:
> when __name__ == '__main__'. Current code will use SYSLOG_IDENTIFIER='',
> and journald will add SYSLOG_IDENTIFIER=python on it's own, which
> looks OK.
>
> Zbyszek
>
Oh yeah, lol. I don't think I thought that one through :)

-- 
Steven Hiscocks


More information about the systemd-devel mailing list