udevadm: rename option '--log-priority' into '--log-level'
Let's be consistent with systemctl(1). '--log-priority' i still kept only for backward compatibility.
This commit is contained in:
parent
64a3494c3d
commit
027f96c851
|
@ -398,7 +398,7 @@
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-l</option></term>
|
<term><option>-l</option></term>
|
||||||
<term><option>--log-priority=<replaceable>value</replaceable></option></term>
|
<term><option>--log-level=<replaceable>value</replaceable></option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Set the internal log level of
|
<para>Set the internal log level of
|
||||||
<filename>systemd-udevd</filename>. Valid values are the
|
<filename>systemd-udevd</filename>. Valid values are the
|
||||||
|
|
|
@ -34,7 +34,7 @@ static int help(void) {
|
||||||
" -h --help Show this help\n"
|
" -h --help Show this help\n"
|
||||||
" -V --version Show package version\n"
|
" -V --version Show package version\n"
|
||||||
" -e --exit Instruct the daemon to cleanup and exit\n"
|
" -e --exit Instruct the daemon to cleanup and exit\n"
|
||||||
" -l --log-priority=LEVEL Set the udev log level for the daemon\n"
|
" -l --log-level=LEVEL Set the udev log level for the daemon\n"
|
||||||
" -s --stop-exec-queue Do not execute events, queue only\n"
|
" -s --stop-exec-queue Do not execute events, queue only\n"
|
||||||
" -S --start-exec-queue Execute events, flush queue\n"
|
" -S --start-exec-queue Execute events, flush queue\n"
|
||||||
" -R --reload Reload rules and databases\n"
|
" -R --reload Reload rules and databases\n"
|
||||||
|
@ -58,7 +58,8 @@ int control_main(int argc, char *argv[], void *userdata) {
|
||||||
|
|
||||||
static const struct option options[] = {
|
static const struct option options[] = {
|
||||||
{ "exit", no_argument, NULL, 'e' },
|
{ "exit", no_argument, NULL, 'e' },
|
||||||
{ "log-priority", required_argument, NULL, 'l' },
|
{ "log-level", required_argument, NULL, 'l' },
|
||||||
|
{ "log-priority", required_argument, NULL, 'l' }, /* for backward compatibility */
|
||||||
{ "stop-exec-queue", no_argument, NULL, 's' },
|
{ "stop-exec-queue", no_argument, NULL, 's' },
|
||||||
{ "start-exec-queue", no_argument, NULL, 'S' },
|
{ "start-exec-queue", no_argument, NULL, 'S' },
|
||||||
{ "reload", no_argument, NULL, 'R' },
|
{ "reload", no_argument, NULL, 'R' },
|
||||||
|
@ -98,11 +99,11 @@ int control_main(int argc, char *argv[], void *userdata) {
|
||||||
case 'l':
|
case 'l':
|
||||||
r = log_level_from_string(optarg);
|
r = log_level_from_string(optarg);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to parse log priority '%s': %m", optarg);
|
return log_error_errno(r, "Failed to parse log level '%s': %m", optarg);
|
||||||
|
|
||||||
r = udev_ctrl_send_set_log_level(uctrl, r);
|
r = udev_ctrl_send_set_log_level(uctrl, r);
|
||||||
if (r == -ENOANO)
|
if (r == -ENOANO)
|
||||||
log_warning("Cannot specify --log-priority after --exit, ignoring.");
|
log_warning("Cannot specify --log-level after --exit, ignoring.");
|
||||||
else if (r < 0)
|
else if (r < 0)
|
||||||
return log_error_errno(r, "Failed to send request to set log level: %m");
|
return log_error_errno(r, "Failed to send request to set log level: %m");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue