[icinga-checkins] icinga.org: icinga-core/dev/cgis: core: drop abbreviations in debug log and make them more telling #2138

git at icinga.org git at icinga.org
Sat Feb 25 21:20:55 CET 2012


Module: icinga-core
Branch: dev/cgis
Commit: 3af766132f4a3a07f5d760653205bfc6df292a7e
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=3af766132f4a3a07f5d760653205bfc6df292a7e

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Thu Feb 23 20:14:36 2012 +0100

core: drop abbreviations in debug log and make them more telling #2138

fixes #2138

---

 Changelog       |    1 +
 base/checks.c   |    6 +++---
 base/events.c   |    3 ++-
 base/flapping.c |    6 ++++--
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Changelog b/Changelog
index f80521c..892bdf3 100644
--- a/Changelog
+++ b/Changelog
@@ -17,6 +17,7 @@ FIXES
 * core: Plug some macro leaks triggered when sending notifications (Andreas Ericsson) #2109
 * core: mark services as executing only when we know we will actually run them (Andreas Ericsson) #2302
 * core: fix handling of allow_empty_hostgroup_assignment when hitting NULL'edhost_name attribute, now properly finishing #949
+* core: drop abbreviations in debug log and make them more telling #2138
 
 * install: Fix notification template installation (Todd Zullinger) #2235
 
diff --git a/base/checks.c b/base/checks.c
index f163204..eedecb7 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -1248,7 +1248,7 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
 		temp_service->current_attempt = temp_service->current_attempt + 1;
 
 
-	log_debug_info(DEBUGL_CHECKS, 2, "ST: %s  CA: %d  MA: %d  CS: %d  LS: %d  LHS: %d\n", (temp_service->state_type == SOFT_STATE) ? "SOFT" : "HARD", temp_service->current_attempt, temp_service->max_attempts, temp_service->current_state, temp_service->last_state, temp_service->last_hard_state);
+	log_debug_info(DEBUGL_CHECKS, 2, "SERVICE: ST (state_type): %s  CA (current_attempt): %d  MA (max_attempt): %d  CS (current_state): %d  LS (last_state): %d  LHS (last_hard_state): %d\n", (temp_service->state_type == SOFT_STATE) ? "SOFT" : "HARD", temp_service->current_attempt, temp_service->max_attempts, temp_service->current_state, temp_service->last_state, temp_service->last_hard_state);
 
 	/* check for a state change (either soft or hard) */
 	if (temp_service->current_state != temp_service->last_state) {
@@ -2287,7 +2287,7 @@ int is_service_result_fresh(service *temp_service, time_t current_time, int log_
 	else
 		expiration_time = (time_t)(temp_service->last_check + freshness_threshold);
 
-	log_debug_info(DEBUGL_CHECKS, 2, "HBC: %d, PS: %lu, ES: %lu, LC: %lu, CT: %lu, ET: %lu\n", temp_service->has_been_checked, (unsigned long)program_start, (unsigned long)event_start, (unsigned long)temp_service->last_check, (unsigned long)current_time, (unsigned long)expiration_time);
+	log_debug_info(DEBUGL_CHECKS, 2, "SERVICE: HBC (has_been_checked): %d, PS (program_start): %lu, ES (event_start): %lu, LC (last_check): %lu, CT (current_time): %lu, ET (expiration_time): %lu\n", temp_service->has_been_checked, (unsigned long)program_start, (unsigned long)event_start, (unsigned long)temp_service->last_check, (unsigned long)current_time, (unsigned long)expiration_time);
 
 	/* the results for the last check of this service are stale */
 	if (expiration_time < current_time) {
@@ -2684,7 +2684,7 @@ int is_host_result_fresh(host *temp_host, time_t current_time, int log_this) {
 	else
 		expiration_time = (time_t)(temp_host->last_check + freshness_threshold);
 
-	log_debug_info(DEBUGL_CHECKS, 2, "HBC: %d, PS: %lu, ES: %lu, LC: %lu, CT: %lu, ET: %lu\n", temp_host->has_been_checked, (unsigned long)program_start, (unsigned long)event_start, (unsigned long)temp_host->last_check, (unsigned long)current_time, (unsigned long)expiration_time);
+	log_debug_info(DEBUGL_CHECKS, 2, "HOST: HBC (has_been_checked): %d, PS (program_start): %lu, ES (event_start): %lu, LC (last_check): %lu, CT (current_time): %lu, ET (expiration_time): %lu\n", temp_host->has_been_checked, (unsigned long)program_start, (unsigned long)event_start, (unsigned long)temp_host->last_check, (unsigned long)current_time, (unsigned long)expiration_time);
 
 	/* the results for the last check of this host are stale */
 	if (expiration_time < current_time) {
diff --git a/base/events.c b/base/events.c
index 3abf9cb..ce8666d 100644
--- a/base/events.c
+++ b/base/events.c
@@ -367,7 +367,8 @@ void init_timing_loop(void) {
 
 			mult_factor = current_interleave_block + (interleave_block_index * total_interleave_blocks);
 
-			log_debug_info(DEBUGL_EVENTS, 2, "CIB: %d, IBI: %d, TIB: %d, SIF: %d\n", current_interleave_block, interleave_block_index, total_interleave_blocks, scheduling_info.service_interleave_factor);
+			log_debug_info(DEBUGL_EVENTS, 2, "CIB (current_interleave_block): %d, IBI (interleave_block_index): %d, TIB (total_interleave_blocks): %d, SIF (service_interleave_factor): %d\n",
+					current_interleave_block, interleave_block_index, total_interleave_blocks, scheduling_info.service_interleave_factor);
 			log_debug_info(DEBUGL_EVENTS, 2, "Mult factor: %d\n", mult_factor);
 
 			/* set the preferred next check time for the service */
diff --git a/base/flapping.c b/base/flapping.c
index 5f3acb5..a45f2bf 100644
--- a/base/flapping.c
+++ b/base/flapping.c
@@ -141,7 +141,8 @@ void check_for_service_flapping(service *svc, int update, int allow_flapstart_no
 
 	svc->percent_state_change = curved_percent_change;
 
-	log_debug_info(DEBUGL_FLAPPING, 2, "LFT=%.2f, HFT=%.2f, CPC=%.2f, PSC=%.2f%%\n", low_threshold, high_threshold, curved_percent_change, curved_percent_change);
+	log_debug_info(DEBUGL_FLAPPING, 2, "LFT (low_threshold): %.2f, HFT (high_threshold): %.2f, CPC (curved_percent_change): %.2f, PSC (curved_percent_change): %.2f%%\n",
+			low_threshold, high_threshold, curved_percent_change, curved_percent_change);
 
 
 	/* don't do anything if we don't have flap detection enabled on a program-wide basis */
@@ -277,7 +278,8 @@ void check_for_host_flapping(host *hst, int update, int actual_check, int allow_
 
 	hst->percent_state_change = curved_percent_change;
 
-	log_debug_info(DEBUGL_FLAPPING, 2, "LFT=%.2f, HFT=%.2f, CPC=%.2f, PSC=%.2f%%\n", low_threshold, high_threshold, curved_percent_change, curved_percent_change);
+	log_debug_info(DEBUGL_FLAPPING, 2, "LFT (low_threshold): %.2f, HFT (high_threshold): %.2f, CPC (curved_percent_change): %.2f, PSC (curved_percent_change): %.2f%%\n",
+			low_threshold, high_threshold, curved_percent_change, curved_percent_change);
 
 
 	/* don't do anything if we don't have flap detection enabled on a program-wide basis */





More information about the icinga-checkins mailing list