[systemd-devel] [RFC PATCH] logs-show: print multiline messages

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Fri May 3 10:55:20 PDT 2013


On Fri, May 03, 2013 at 06:51:35PM +0200, Lennart Poettering wrote:
> On Wed, 24.04.13 10:30, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> 
> > [    0.019862] fedora kernel: CPU0: Thermal monitoring enabled (TM1)
> > [    0.019900] fedora kernel: Last level iTLB entries: 4KB 512, 2MB 0, 4MB 0
> >                               Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32
> >                               tlb_flushall_shift: 5
> > [    0.020118] fedora kernel: Freeing SMP alternatives: 24k freed
> > ---
> > A beginning of support for multiline messages. Is this the right approach?
> > 
> > (Not all formats are updated).
> 
> Hmm, maybe a simpler approach regarding the expansion of \n would be to
> extend strip_tab_ansi() to take an additional string param for what to
> expand \n to? I think that would be a much simpler patch, no?
We want to align fields, so it is necessary to split them on '\n'.
Otherwise it'd look like

[    0.019862] fedora kernel: CPU0: Thermal monitoring enabled (TM1)
[    0.019900] fedora kernel: Last level iTLB entries: 4KB 512, 2MB 0, 4MB 0
Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32
tlb_flushall_shift: 5
[    0.020118] fedora kernel: Freeing SMP alternatives: 24k freed

which is definitely not pretty.

> I guess, more or less. Though i'd probably change utf8_is_printable() to
> always say that \n is an OK char to print. Doing the destinction between
> is_printable_n() vs is_printable_oneline() sounds unnecessarily complex?
json output will require some tweaking. I'll prep a patch.

Zbyszek


More information about the systemd-devel mailing list