Module: check_mk
Branch: master
Commit: 3b45f3b35faf32151d96b1fecb2cbe4ef2be02a2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3b45f3b35faf32…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Apr 23 13:44:29 2013 +0200
livestatus.log: show utf-8 decoding problems only with debug logging >=2
---
ChangeLog | 1 +
livestatus/src/Query.cc | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d4885e3..df5cb2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@
* Table statehist: Improved detection of vanished hosts and services.
Now able to detect and remove nonsense check plugin output
* FIX: able to handle equal comment_id between host and service
+ * livestatus.log: show utf-8 decoding problems only with debug logging >=2
BI:
* Integrated availability computing, including nifty time warp feature
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index fb5e639..bfd941c 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -1029,7 +1029,8 @@ void Query::outputString(const char *value)
// three-byte sequences (avoid buffer overflow!)
if ((*r & 0xF0) == 0xE0) {
if (chars_left < 3) {
- logger(LG_INFO, "Ignoring invalid UTF-8 sequence in string
'%s'", value);
+ if (g_debug_level >= 2)
+ logger(LG_INFO, "Ignoring invalid UTF-8 sequence in
string '%s'", value);
break; // end of string. No use in continuing
}
else {
@@ -1044,7 +1045,8 @@ void Query::outputString(const char *value)
// four-byte sequences
else if ((*r & 0xF8) == 0xF0) {
if (chars_left < 4) {
- logger(LG_INFO, "Ignoring invalid UTF-8 sequence in string
'%s'", value);
+ if (g_debug_level >= 2)
+ logger(LG_INFO, "Ignoring invalid UTF-8 sequence in
string '%s'", value);
break; // end of string. No use in continuing
}
else {