diff --git a/src/init.cpp b/src/init.cpp index d226e7df..1024df61 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -192,6 +192,9 @@ void initializeDataAndRules ( if (rules.has ("debug.indicator")) setDebugIndicator (rules.get ("debug.indicator")); + if (rules.has ("theme.colors.debug")) + setDebugColor (Color (rules.get ("theme.colors.debug"))); + // Apply command line overrides. for (auto& arg : cli._args) { diff --git a/src/log.cpp b/src/log.cpp index aaac54c1..a544d690 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -31,6 +31,7 @@ static bool debugMode = false; static std::string debugIndicator = ">>"; +static Color debugColor; //////////////////////////////////////////////////////////////////////////////// void enableDebugMode (bool value) @@ -45,10 +46,16 @@ void setDebugIndicator (const std::string& indicator) } //////////////////////////////////////////////////////////////////////////////// -void debug (const std::string& msg) +void setDebugColor (const Color& color) { - if (debugMode) - std::cout << Color ("gray4").colorize (debugIndicator + " " + msg) << "\n"; + debugColor = color; +} + +//////////////////////////////////////////////////////////////////////////////// +void debug (const std::string& msg) +{ + if (debugMode) + std::cout << debugColor.colorize (debugIndicator + " " + msg) << "\n"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/timew.h b/src/timew.h index 2c001322..71c97a11 100644 --- a/src/timew.h +++ b/src/timew.h @@ -77,6 +77,7 @@ std::string minimalDelta (const Datetime&, const Datetime&); // log.cpp void enableDebugMode (bool); void setDebugIndicator (const std::string&); +void setDebugColor (const Color&); void debug (const std::string&); // utiƀ.cpp