Skip to content

Commit b4c87f7

Browse files
committed
man: reuse common-variables in systemd(1)
This requires a bit of gimnastics, but I think it's still better than status quo ante, and better than duplicating the text.
1 parent 969524f commit b4c87f7

File tree

2 files changed

+36
-31
lines changed

2 files changed

+36
-31
lines changed

man/common-variables.xml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<varlistentry id='log-level'>
1111
<term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
1212

13-
<listitem><para>The maximum log level of emitted messages (messages with a higher log level, i.e. less
14-
important ones, will be suppressed). Either one of (in order of decreasing importance)
15-
<constant>emerg</constant>, <constant>alert</constant>, <constant>crit</constant>,
13+
<listitem><para id='log-level-body'>The maximum log level of emitted messages (messages with a higher
14+
log level, i.e. less important ones, will be suppressed). Either one of (in order of decreasing
15+
importance) <constant>emerg</constant>, <constant>alert</constant>, <constant>crit</constant>,
1616
<constant>err</constant>, <constant>warning</constant>, <constant>notice</constant>,
1717
<constant>info</constant>, <constant>debug</constant>, or an integer in the range 0…7. See
1818
<citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
@@ -23,8 +23,8 @@
2323
<varlistentry id='log-color'>
2424
<term><varname>$SYSTEMD_LOG_COLOR</varname></term>
2525

26-
<listitem><para>A boolean. If true, messages written to the tty will be colored according to
27-
priority.</para>
26+
<listitem><para id='log-color-body'>A boolean. If true, messages written to the tty will be colored
27+
according to priority.</para>
2828

2929
<para>This setting is only useful when messages are written directly to the terminal, because
3030
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
@@ -35,7 +35,8 @@
3535
<varlistentry id='log-time'>
3636
<term><varname>$SYSTEMD_LOG_TIME</varname></term>
3737

38-
<listitem><para>A boolean. If true, log messages will be prefixed with a timestamp.</para>
38+
<listitem><para id='log-time-body'>A boolean. If true, log messages will be prefixed with a
39+
timestamp.</para>
3940

4041
<para>This setting is only useful when messages are written directly to the terminal or a file, because
4142
<citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> and
@@ -46,8 +47,8 @@
4647
<varlistentry id='log-location'>
4748
<term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
4849

49-
<listitem><para>A boolean. If true, messages will be prefixed with a filename and line number
50-
in the source code where the message originates.</para>
50+
<listitem><para id='log-location-body'>A boolean. If true, messages will be prefixed with a filename
51+
and line number in the source code where the message originates.</para>
5152

5253
<para>Note that the log location is often attached as metadata to journal entries anyway. Including it
5354
directly in the message text can nevertheless be convenient when debugging programs.</para>
@@ -57,8 +58,8 @@
5758
<varlistentry id='log-tid'>
5859
<term><varname>$SYSTEMD_LOG_TID</varname></term>
5960

60-
<listitem><para>A boolean. If true, messages will be prefixed with the current numerical thread ID
61-
(TID).</para>
61+
<listitem><para id='log-tid-body'>A boolean. If true, messages will be prefixed with the current
62+
numerical thread ID (TID).</para>
6263

6364
<para>Note that the this information is attached as metadata to journal entries anyway. Including it
6465
directly in the message text can nevertheless be convenient when debugging programs.</para>
@@ -68,9 +69,9 @@
6869
<varlistentry id='log-target'>
6970
<term><varname>$SYSTEMD_LOG_TARGET</varname></term>
7071

71-
<listitem><para>The destination for log messages. One of <constant>console</constant> (log to the
72-
attached tty), <constant>console-prefixed</constant> (log to the attached tty but with prefixes
73-
encoding the log level and "facility", see <citerefentry
72+
<listitem><para id='log-target-body'>The destination for log messages. One of
73+
<constant>console</constant> (log to the attached tty), <constant>console-prefixed</constant> (log to
74+
the attached tty but with prefixes encoding the log level and "facility", see <citerefentry
7475
project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
7576
<constant>kmsg</constant> (log to the kernel circular log buffer), <constant>journal</constant> (log to
7677
the journal), <constant>journal-or-kmsg</constant> (log to the journal if available, and to kmsg

man/systemd.xml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -629,39 +629,43 @@
629629

630630
<variablelist class='environment-variables'>
631631
<varlistentry>
632-
<term><varname>$SYSTEMD_LOG_COLOR</varname></term>
633-
<listitem><para>Controls whether systemd highlights important log messages. This can be overridden
634-
with <option>--log-color=</option>.</para></listitem>
632+
<term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
633+
<listitem><xi:include href="common-variables.xml" xpointer="log-level-body" />
634+
635+
<para>This can be overridden with <option>--log-level=</option>.</para></listitem>
635636
</varlistentry>
636637

637638
<varlistentry>
638-
<term><varname>$SYSTEMD_LOG_LEVEL</varname></term>
639-
<listitem><para>systemd reads the log level from this environment variable. This can be overridden
640-
with <option>--log-level=</option>.</para></listitem>
639+
<term><varname>$SYSTEMD_LOG_COLOR</varname></term>
640+
<listitem><xi:include href="common-variables.xml" xpointer="log-color-body" />
641+
642+
<para>This can be overridden with <option>--log-color=</option>.</para></listitem>
641643
</varlistentry>
642644

643645
<varlistentry>
644-
<term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
645-
<listitem><para>Controls whether systemd prints the code location along with log messages. This can
646-
be overridden with <option>--log-location=</option>.</para></listitem>
646+
<term><varname>$SYSTEMD_LOG_TIME</varname></term>
647+
<listitem><xi:include href="common-variables.xml" xpointer="log-time-body" />
648+
649+
<para>This can be overridden with <option>--log-time=</option>.</para></listitem>
647650
</varlistentry>
648651

649652
<varlistentry>
650-
<term><varname>$SYSTEMD_LOG_TARGET</varname></term>
651-
<listitem><para>systemd reads the log target from this environment variable. This can be overridden
652-
with <option>--log-target=</option>.</para></listitem>
653+
<term><varname>$SYSTEMD_LOG_LOCATION</varname></term>
654+
<listitem><xi:include href="common-variables.xml" xpointer="log-location-body" />
655+
656+
<para>This can be overridden with <option>--log-location=</option>.</para></listitem>
653657
</varlistentry>
654658

655659
<varlistentry>
656-
<term><varname>$SYSTEMD_LOG_TIME</varname></term>
657-
<listitem><para>Controls whether systemd prefixes log messages with the current time. This can be
658-
overridden with <option>--log-time=</option>.</para></listitem>
660+
<term><varname>$SYSTEMD_LOG_TID</varname></term>
661+
<listitem><xi:include href="common-variables.xml" xpointer="log-tid-body" /></listitem>
659662
</varlistentry>
660663

661664
<varlistentry>
662-
<term><varname>$SYSTEMD_LOG_TID</varname></term>
663-
<listitem><para>Controls whether systemd prefixes log messages with the current thread ID
664-
(TID).</para></listitem>
665+
<term><varname>$SYSTEMD_LOG_TARGET</varname></term>
666+
<listitem><xi:include href="common-variables.xml" xpointer="log-target-body" />
667+
668+
<para>This can be overridden with <option>--log-target=</option>.</para></listitem>
665669
</varlistentry>
666670

667671
<varlistentry>

0 commit comments

Comments
 (0)