summaryrefslogtreecommitdiff
path: root/lib/common/Logging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/Logging.cpp')
-rw-r--r--lib/common/Logging.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/common/Logging.cpp b/lib/common/Logging.cpp
index 1666b487..296443ea 100644
--- a/lib/common/Logging.cpp
+++ b/lib/common/Logging.cpp
@@ -33,6 +33,8 @@ bool Logging::sLogToSyslog = false;
bool Logging::sLogToConsole = false;
bool Logging::sContextSet = false;
+bool HideExceptionMessageGuard::sHiddenState = false;
+
std::vector<Logger*> Logging::sLoggers;
std::string Logging::sContext;
Console* Logging::spConsole = NULL;
@@ -493,3 +495,24 @@ bool FileLogger::Log(Log::Level Level, const std::string& rFile,
Logging::Add(this);
return true;
}
+
+std::string PrintEscapedBinaryData(const std::string& rInput)
+{
+ std::ostringstream output;
+
+ for (size_t i = 0; i < rInput.length(); i++)
+ {
+ if (isprint(rInput[i]))
+ {
+ output << rInput[i];
+ }
+ else
+ {
+ output << "\\x" << std::hex << std::setw(2) <<
+ std::setfill('0') << (int) rInput[i] <<
+ std::dec;
+ }
+ }
+
+ return output.str();
+}