From b9d2587f20fdd12a3ff11541249e04c4206f0d03 Mon Sep 17 00:00:00 2001 From: Davidson Francis Date: Sat, 3 Aug 2024 17:15:35 -0300 Subject: [PATCH] Bug Fix: Replace printf to log_msg --- env_events.c | 19 ++++++++----------- events.c | 8 +++----- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/env_events.c b/env_events.c index dbae440..7eac461 100644 --- a/env_events.c +++ b/env_events.c @@ -405,17 +405,14 @@ int init_environment_events(void) } log_msg("Environment events summary:\n"); - for (int i = 0; i < num_env_events; i++) { - printf( - "EVENT%d_MATCH_TYPE: %s\n" - "EVENT%d_MATCH_STR: %s\n" - "EVENT%d_NOTIFIER: %s\n" - "EVENT%d_MASK_MSG: %s\n\n", - i, match_types[env_events[i].ev_match_type], - i, env_events[i].ev_match_str, - i, notifiers_str[env_events[i].ev_notifier_idx], - i, env_events[i].ev_mask_msg - ); + for (int i = 0; i < num_env_events; i++) + { + log_msg("EVENT%d_MATCH_TYPE: %s\n", i, + match_types[env_events[i].ev_match_type]); + log_msg("EVENT%d_MATCH_STR: %s\n", i, env_events[i].ev_match_str); + log_msg("EVENT%d_NOTIFIER: %s\n", i, + notifiers_str[env_events[i].ev_notifier_idx]); + log_msg("EVENT%d_MASK_MSG: %s\n\n", i, env_events[i].ev_mask_msg); /* Try to setup notifier if not yet. */ self = ¬ifiers[env_events[i].ev_notifier_idx]; diff --git a/events.c b/events.c index 395f7c0..70712e9 100644 --- a/events.c +++ b/events.c @@ -166,11 +166,9 @@ int init_static_events(void) if (!static_events[i].enabled) continue; - printf( - "STATIC_EVENT%d : enabled\n" - "STATIC_EVENT%d_NOTIFIER: %s\n\n", - i, i, notifiers_str[static_events[i].ev_notifier_idx] - ); + log_msg("STATIC_EVENT%d : enabled\n", i); + log_msg("STATIC_EVENT%d_NOTIFIER: %s\n\n", + i, notifiers_str[static_events[i].ev_notifier_idx]); /* Try to setup notifier if not yet. */ self = ¬ifiers[static_events[i].ev_notifier_idx];