mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
log: Debugging prefix now configurable
This commit is contained in:
parent
d975631c9b
commit
3a0242e317
3 changed files with 14 additions and 5 deletions
13
src/log.cpp
13
src/log.cpp
|
@ -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";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue