about summary refs log tree commit diff
path: root/src/core/main.c
diff options
context:
space:
mode:
authorJeremy Bicha <jeremy.bicha@canonical.com>2022-08-18 08:31:29 -0400
committerJeremy Bicha <jeremy.bicha@canonical.com>2022-08-18 08:31:29 -0400
commitb0887dd4d035acc0d84aa859748d36891548eaaf (patch)
treec4dc0dae50954f3c8fb600aa9e7cfaabeb80deb0 /src/core/main.c
parent1a62dcfdc0470be37743914da69fe0b0677c6bfb (diff)
parent4741f1a52215c7ba466140912084d6906185bef3 (diff)
Merge branch 'debian/master' into ubuntu/master
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 1a9c3a65..2eb230d9 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -293,6 +293,7 @@ main(int argc, char *argv[])
     GError                 *error_invalid_logging_config = NULL;
     const char *const      *warnings;
     int                     errsv;
+    gboolean                has_logging = FALSE;
 
     _nm_utils_is_manager_process = TRUE;
 
@@ -354,10 +355,14 @@ main(int argc, char *argv[])
         g_free(path);
     }
 
-    if (!nm_logging_setup(global_opt.opt_log_level,
-                          global_opt.opt_log_domains,
-                          &bad_domains,
-                          &error)) {
+    if (nm_config_kernel_command_line_nm_debug()) {
+        /* we honor kernel command line. If "nm.debug" is set, we always enable trace logging. */
+        nm_logging_setup("TRACE", "ALL", NULL, NULL);
+        has_logging = TRUE;
+    } else if (!nm_logging_setup(global_opt.opt_log_level,
+                                 global_opt.opt_log_domains,
+                                 &bad_domains,
+                                 &error)) {
         fprintf(stderr,
                 _("%s.  Please use --help to see a list of valid options.\n"),
                 error->message);
@@ -379,7 +384,7 @@ main(int argc, char *argv[])
     /* Initialize logging from config file *only* if not explicitly
      * specified by commandline.
      */
-    if (global_opt.opt_log_level == NULL && global_opt.opt_log_domains == NULL) {
+    if (!has_logging && !global_opt.opt_log_level && !global_opt.opt_log_domains) {
         if (!nm_logging_setup(nm_config_get_log_level(config),
                               nm_config_get_log_domains(config),
                               &bad_domains,
@@ -417,9 +422,10 @@ main(int argc, char *argv[])
     }
 
     nm_log_info(LOGD_CORE,
-                "NetworkManager (version " NM_DIST_VERSION ") is starting... (%s%s)",
-                nm_config_get_first_start(config) ? "for the first time" : "after a restart",
-                NM_MORE_ASSERTS != 0 ? ", asserts:" G_STRINGIFY(NM_MORE_ASSERTS) : "");
+                "NetworkManager (version " NM_DIST_VERSION ") is starting... (%s%sboot:%s)",
+                nm_config_get_first_start(config) ? "" : "after a restart, ",
+                NM_MORE_ASSERTS != 0 ? "asserts:" G_STRINGIFY(NM_MORE_ASSERTS) ", " : "",
+                nm_utils_boot_id_str());
 
     nm_log_info(LOGD_CORE,
                 "Read config: %s",