[systemd-devel] PATCH: Integration with Python logging framework
David Strauss
david at davidstrauss.net
Sun Oct 14 04:22:29 PDT 2012
On Tue, Oct 9, 2012 at 9:36 AM, Marti Raudsepp <marti at juffo.org> wrote:
> The attached patch implements journal integration for the Python
> logging framework. Tested on my Arch Linux machine, using Python 2.7
> and 3.2, but should be compatible with all versions from 2.5 through
> 3.3
This support has been on my task list for a while. Thanks for taking a
first stab at it. A cursory look at the patch looks promising, and
I'll probably commit it after some basic testing in the next few days.
We can refine structured field support after some more discussion.
There's no obvious way to make everyone happy there. I see your
approach is with an "extra" dictionary. I've also considered abusing
the translation substitution support in logging to put the variable
values in into separate fields (in addition to using the composed
string as MESSAGE=), since (1) those values are identified by a key
for the purpose of substitution and (2) those values are generally the
same values you'd want to use for filtering. It may also be possible
to hash the pre-substitution, pre-translation string to seed
generation of a message UUID.
--David
More information about the systemd-devel
mailing list