From c97f7b54fee9e5c48b8269bdce708ec716c6a75a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 27 Nov 2015 10:34:38 +0100 Subject: [PATCH] nmtst: support shorthand "NMTST_DEBUG=TRACE" to set logging level --- include/nm-test-utils.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h index 9fc6fad61..09ba64276 100644 --- a/include/nm-test-utils.h +++ b/include/nm-test-utils.h @@ -69,6 +69,8 @@ * If you set the level to DEBUG or TRACE, it also sets G_MESSAGES_DEBUG=all (unless * in assert-logging mode and unless G_MESSAGES_DEBUG is already defined). * + * "TRACE", this is shorthand for "log-level=TRACE". + * * "sudo-cmd=PATH": when running root tests as normal user, the test will execute * itself by invoking sudo at PATH. * For example @@ -322,6 +324,9 @@ __nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_ } else if (!g_ascii_strncasecmp (debug, "log-level=", strlen ("log-level="))) { g_free (c_log_level); log_level = c_log_level = g_strdup (&debug[strlen ("log-level=")]); + } else if (!g_ascii_strcasecmp (debug, "TRACE")) { + g_free (c_log_level); + log_level = c_log_level = g_strdup (debug); } else if (!g_ascii_strncasecmp (debug, "log-domains=", strlen ("log-domains="))) { g_free (c_log_domains); log_domains = c_log_domains = g_strdup (&debug[strlen ("log-domains=")]);