[systemd-devel] [RFC/PATCH] journal: new logging macros to include _SYSTEMD_UNIT

Lennart Poettering lennart at poettering.net
Wed Dec 19 13:23:39 PST 2012


On Wed, 05.12.12 10:55, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> Adding _SYSTEMD_UNIT= to log lines allows them to be shown
> in 'systemctl status' output, etc.
> 
> A new set of macros and functions is added. This allows for less
> verbose notation than using log_struct() explicitly. Just a few
> example log lines are modified to show the usage.

Cool stuff. I actually had something similar on my list for quite some
time.

I'd prefer though not to litter the very generic log.c with unit
specific stuff. So, maybe we can find a way that we can implement some
generic macros which can be used as basis for specific
object-type-specific log messages?

i.e. something such as log_object_debug(), log_object_info(), ... which
we can use to define log_unit_debug(), log_unit_info(), ... in unit.h,
but to log_job_debug(), log_job_info(), ... in job.h, and similar. After
all, units are not the only objects we deal with, there's much more. For
example, maybe udev would like to make use for that for its devices, and
so on...

Really like the idea!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list