diff --git a/src/init.cpp b/src/init.cpp index 81701977..3eb02450 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -180,6 +180,9 @@ void initializeDataAndRules ( if (shinyNewDatabase) rules.set ("temp.shiny", 1); + if (rules.has ("debug.indicator")) + setDebugIndicator (rules.get ("debug.indicator")); + // Initialize the database (no data read), but files are enumerated. database.initialize (data._data); diff --git a/src/log.cpp b/src/log.cpp index 76eee189..aaac54c1 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -30,6 +30,7 @@ #include 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"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/timew.h b/src/timew.h index 33418395..e4aebe8f 100644 --- a/src/timew.h +++ b/src/timew.h @@ -74,9 +74,8 @@ bool dayIsHoliday (const Rules&, const Datetime&); // log.cpp void enableDebugMode (bool); -void enableQuietMode (bool); +void setDebugIndicator (const std::string&); void debug (const std::string&); -void error (const std::string&); // utiƀ.cpp std::string osName ();