summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-04-14 12:03:05 +0200
committerThomas Haller <thaller@redhat.com>2014-06-05 18:12:56 +0200
commit86693d237810d9380974bb7ca59ec5a420029020 (patch)
tree836684213c407eead5ef6f2649392a45d3303fd7 /include
parent17c300b816592008ee9fb0633c3f24e766150b14 (diff)
downloadNetworkManager-86693d237810d9380974bb7ca59ec5a420029020.tar.gz
nmtst: add parameter to nmtst_init to setup nm-logging
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/nm-test-utils.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h
index 8de9d15861..20e867f0b8 100644
--- a/include/nm-test-utils.h
+++ b/include/nm-test-utils.h
@@ -41,7 +41,7 @@ extern struct __nmtst_internal __nmtst_internal;
struct __nmtst_internal __nmtst_internal = { 0 };
inline static void
-nmtst_init (int *argc, char ***argv)
+nmtst_init (int *argc, char ***argv, const char *log_level, const char *log_domains)
{
g_assert (!__nmtst_internal.rand0);
@@ -58,6 +58,14 @@ nmtst_init (int *argc, char ***argv)
#endif
__nmtst_internal.rand0 = g_rand_new_with_seed (0);
+
+ if (log_level || log_domains) {
+ gboolean success = FALSE;
+#ifdef NM_LOGGING_H
+ success = nm_logging_setup (log_level, log_domains, NULL, NULL);
+#endif
+ g_assert (success);
+ }
}
inline static GRand *