mirror of
https://github.com/systemd/systemd
synced 2024-10-14 20:17:52 +00:00
Use log "level" instead of "priority"
The term "priority" is misleading because higher levels have lower priority. "Level" is clearer and shorter. This commit touches only the textual descriptions, not function and variable names themselves. "Priority" is used in various command-line switches and protocol constants, so completly getting rid of "priority" is hard. I also left "priority" in various places where the clarity suffered when it was removed.
This commit is contained in:
parent
ee7122c0ec
commit
f47ad59316
4
NEWS
4
NEWS
|
@ -1971,8 +1971,8 @@ CHANGES WITH 207:
|
||||||
certain paths from operation.
|
certain paths from operation.
|
||||||
|
|
||||||
* journald will now automatically flush all messages to disk
|
* journald will now automatically flush all messages to disk
|
||||||
as soon as a message of the log priorities CRIT, ALERT or
|
as soon as a message at the log level CRIT, ALERT or EMERG
|
||||||
EMERG is received.
|
is received.
|
||||||
|
|
||||||
Contributions from: Andrew Cook, Brandon Philips, Christian
|
Contributions from: Andrew Cook, Brandon Philips, Christian
|
||||||
Hesse, Christoph Junghans, Colin Walters, Daniel Schaal,
|
Hesse, Christoph Junghans, Colin Walters, Daniel Schaal,
|
||||||
|
|
2
TODO
2
TODO
|
@ -364,8 +364,6 @@ Features:
|
||||||
|
|
||||||
* think about window-manager-run-as-user-service problem: exit 0 → activate shutdown.target; exit != 0 → restart service
|
* think about window-manager-run-as-user-service problem: exit 0 → activate shutdown.target; exit != 0 → restart service
|
||||||
|
|
||||||
* use "log level" rather than "log priority" everywhere
|
|
||||||
|
|
||||||
* merge unit_kill_common() and unit_kill_context()
|
* merge unit_kill_common() and unit_kill_context()
|
||||||
|
|
||||||
* introduce ExecCondition= in services
|
* introduce ExecCondition= in services
|
||||||
|
|
|
@ -328,14 +328,14 @@
|
||||||
to simply log to standard error via
|
to simply log to standard error via
|
||||||
<function>fprintf()</function>, which
|
<function>fprintf()</function>, which
|
||||||
is then forwarded to syslog by the
|
is then forwarded to syslog by the
|
||||||
init system. If log priorities are
|
init system. If log levels are
|
||||||
necessary, these can be encoded by
|
necessary, these can be encoded by
|
||||||
prefixing individual log lines with
|
prefixing individual log lines with
|
||||||
strings like <literal><4></literal> (for log
|
strings like <literal><4></literal> (for log
|
||||||
priority 4 "WARNING" in the syslog
|
level 4 "WARNING" in the syslog
|
||||||
priority scheme), following a similar
|
priority scheme), following a similar
|
||||||
style as the Linux kernel's
|
style as the Linux kernel's
|
||||||
<function>printk()</function> priority
|
<function>printk()</function> level
|
||||||
system. For details, see
|
system. For details, see
|
||||||
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||||
and
|
and
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<filename>syslog.h</filename>, see
|
<filename>syslog.h</filename>, see
|
||||||
<citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
<citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||||
for details. The third argument is a boolean: if true
|
for details. The third argument is a boolean: if true
|
||||||
kernel-style log priority level prefixes (such as
|
kernel-style log level prefixes (such as
|
||||||
<constant>SD_WARNING</constant>) are interpreted, see
|
<constant>SD_WARNING</constant>) are interpreted, see
|
||||||
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
<citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>
|
||||||
for more information.</para>
|
for more information.</para>
|
||||||
|
|
|
@ -134,7 +134,7 @@
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>$UDEV_LOG=</varname></term>
|
<term><varname>$UDEV_LOG=</varname></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Set the logging priority.</para>
|
<para>Set the log level.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
<term><varname>udev.log-priority=</varname></term>
|
<term><varname>udev.log-priority=</varname></term>
|
||||||
<term><varname>rd.udev.log-priority=</varname></term>
|
<term><varname>rd.udev.log-priority=</varname></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Set the logging priority.</para>
|
<para>Set the log level.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
<term><varname>udev_log</varname></term>
|
<term><varname>udev_log</varname></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The logging priority. Valid values are the numerical
|
<para>The log level. Valid values are the numerical
|
||||||
syslog priorities or their textual representations:
|
syslog priorities or their textual representations:
|
||||||
<option>err</option>, <option>info</option> and
|
<option>err</option>, <option>info</option> and
|
||||||
<option>debug</option>.</para>
|
<option>debug</option>.</para>
|
||||||
|
|
|
@ -79,7 +79,7 @@ static void log_stderr(struct udev *udev,
|
||||||
* @udev: udev library context
|
* @udev: udev library context
|
||||||
*
|
*
|
||||||
* Retrieve stored data pointer from library context. This might be useful
|
* Retrieve stored data pointer from library context. This might be useful
|
||||||
* to access from callbacks like a custom logging function.
|
* to access from callbacks like a custom log function.
|
||||||
*
|
*
|
||||||
* Returns: stored userdata
|
* Returns: stored userdata
|
||||||
**/
|
**/
|
||||||
|
@ -197,7 +197,7 @@ _public_ struct udev *udev_new(void)
|
||||||
|
|
||||||
prio = util_log_priority(val);
|
prio = util_log_priority(val);
|
||||||
if (prio < 0)
|
if (prio < 0)
|
||||||
udev_err(udev, "/etc/udev/udev.conf:%u: invalid logging level '%s', ignoring.\n", line_nr, val);
|
udev_err(udev, "/etc/udev/udev.conf:%u: invalid log level '%s', ignoring.\n", line_nr, val);
|
||||||
else
|
else
|
||||||
udev_set_log_priority(udev, prio);
|
udev_set_log_priority(udev, prio);
|
||||||
continue;
|
continue;
|
||||||
|
@ -212,7 +212,7 @@ _public_ struct udev *udev_new(void)
|
||||||
|
|
||||||
prio = util_log_priority(env);
|
prio = util_log_priority(env);
|
||||||
if (prio < 0)
|
if (prio < 0)
|
||||||
udev_err(udev, "$UDEV_LOG specifies invalid logging level '%s', ignoring.\n", env);
|
udev_err(udev, "$UDEV_LOG specifies invalid log level '%s', ignoring.\n", env);
|
||||||
else
|
else
|
||||||
udev_set_log_priority(udev, prio);
|
udev_set_log_priority(udev, prio);
|
||||||
}
|
}
|
||||||
|
@ -260,11 +260,11 @@ _public_ struct udev *udev_unref(struct udev *udev)
|
||||||
/**
|
/**
|
||||||
* udev_set_log_fn:
|
* udev_set_log_fn:
|
||||||
* @udev: udev library context
|
* @udev: udev library context
|
||||||
* @log_fn: function to be called for logging messages
|
* @log_fn: function to be called for log messages
|
||||||
*
|
*
|
||||||
* The built-in logging writes to stderr. It can be
|
* The built-in logging writes to stderr. It can be
|
||||||
* overridden by a custom function, to plug log messages
|
* overridden by a custom function, to plug log messages
|
||||||
* into the users' logging functionality.
|
* into the users' log functionality.
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
_public_ void udev_set_log_fn(struct udev *udev,
|
_public_ void udev_set_log_fn(struct udev *udev,
|
||||||
|
@ -273,17 +273,16 @@ _public_ void udev_set_log_fn(struct udev *udev,
|
||||||
const char *format, va_list args))
|
const char *format, va_list args))
|
||||||
{
|
{
|
||||||
udev->log_fn = log_fn;
|
udev->log_fn = log_fn;
|
||||||
udev_dbg(udev, "custom logging function %p registered\n", log_fn);
|
udev_dbg(udev, "custom log function %p registered\n", log_fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* udev_get_log_priority:
|
* udev_get_log_priority:
|
||||||
* @udev: udev library context
|
* @udev: udev library context
|
||||||
*
|
*
|
||||||
* The initial logging priority is read from the udev config file
|
* The initial log level is read from the udev config file at startup.
|
||||||
* at startup.
|
|
||||||
*
|
*
|
||||||
* Returns: the current logging priority
|
* Returns: the current log level
|
||||||
**/
|
**/
|
||||||
_public_ int udev_get_log_priority(struct udev *udev)
|
_public_ int udev_get_log_priority(struct udev *udev)
|
||||||
{
|
{
|
||||||
|
@ -293,10 +292,9 @@ _public_ int udev_get_log_priority(struct udev *udev)
|
||||||
/**
|
/**
|
||||||
* udev_set_log_priority:
|
* udev_set_log_priority:
|
||||||
* @udev: udev library context
|
* @udev: udev library context
|
||||||
* @priority: the new logging priority
|
* @priority: the new log priority
|
||||||
*
|
*
|
||||||
* Set the current logging priority. The value controls which messages
|
* Set the log level. This value controls which messages are logged.
|
||||||
* are logged.
|
|
||||||
**/
|
**/
|
||||||
_public_ void udev_set_log_priority(struct udev *udev, int priority)
|
_public_ void udev_set_log_priority(struct udev *udev, int priority)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue