]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: Hide "Deactivated successfully" message
authorJan Macku <jamacku@redhat.com>
Thu, 27 May 2021 10:25:51 +0000 (12:25 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 17 Jun 2021 12:10:30 +0000 (13:10 +0100)
Show message "Deactivated successfully" in debug mode (when manager is
user) rather than in info mode. This message has low information value
for regular users and it might be a bit overwhelming on a system with
a lot of devices.

src/core/unit.c

index 4dc6ff08d692d47d81b2a84e44d66da0ab38963a..0cfb2aa281f0ffe146bb54575ac7485aaadfd0f1 100644 (file)
@@ -5520,7 +5520,11 @@ int unit_pid_attachable(Unit *u, pid_t pid, sd_bus_error *error) {
 void unit_log_success(Unit *u) {
         assert(u);
 
-        log_unit_struct(u, LOG_INFO,
+        /* Let's show message "Deactivated successfully" in debug mode (when manager is user) rather than in info mode.
+         * This message has low information value for regular users and it might be a bit overwhelming on a system with
+         * a lot of devices. */
+        log_unit_struct(u,
+                        MANAGER_IS_USER(u->manager) ? LOG_DEBUG : LOG_INFO,
                         "MESSAGE_ID=" SD_MESSAGE_UNIT_SUCCESS_STR,
                         LOG_UNIT_INVOCATION_ID(u),
                         LOG_UNIT_MESSAGE(u, "Deactivated successfully."));