log: Debugging prefix now configurable

This commit is contained in:
Paul Beckingham 2016-05-28 16:42:25 -04:00
parent d975631c9b
commit 3a0242e317
3 changed files with 14 additions and 5 deletions

View file

@ -30,6 +30,7 @@
#include <iostream>
static bool debugMode = false;
static std::string debugIndicator = ">>";
////////////////////////////////////////////////////////////////////////////////
void enableDebugMode (bool value)
@ -38,10 +39,16 @@ void enableDebugMode (bool value)
}
////////////////////////////////////////////////////////////////////////////////
void debug (const std::string& msg)
void setDebugIndicator (const std::string& indicator)
{
if (debugMode)
std::cout << Color ("gray4").colorize (">> " + msg) << "\n";
debugIndicator = indicator;
}
////////////////////////////////////////////////////////////////////////////////
void debug (const std::string& msg)
{
if (debugMode)
std::cout << Color ("gray4").colorize (debugIndicator + " " + msg) << "\n";
}
////////////////////////////////////////////////////////////////////////////////