Add --verbosity,-l command line option
Allow to fine-control logging verbosity via command line and LogPolicy setting (useful when OSRM used as library). Closes #4299
This commit is contained in:
committed by
Patrick Niklaus
parent
fb5bd818d9
commit
7323221e3b
+10
-3
@@ -7,9 +7,10 @@
|
||||
|
||||
enum LogLevel
|
||||
{
|
||||
logINFO,
|
||||
logWARNING,
|
||||
logNONE,
|
||||
logERROR,
|
||||
logWARNING,
|
||||
logINFO,
|
||||
logDEBUG
|
||||
};
|
||||
|
||||
@@ -27,14 +28,20 @@ class LogPolicy
|
||||
|
||||
bool IsMute() const;
|
||||
|
||||
LogLevel GetLevel() const;
|
||||
void SetLevel(LogLevel level);
|
||||
void SetLevel(std::string const &level);
|
||||
|
||||
static LogPolicy &GetInstance();
|
||||
static std::string GetLevels();
|
||||
|
||||
LogPolicy(const LogPolicy &) = delete;
|
||||
LogPolicy &operator=(const LogPolicy &) = delete;
|
||||
|
||||
private:
|
||||
LogPolicy() : m_is_mute(true) {}
|
||||
LogPolicy() : m_is_mute(true), m_level(logINFO) {}
|
||||
std::atomic<bool> m_is_mute;
|
||||
LogLevel m_level;
|
||||
};
|
||||
|
||||
class Log
|
||||
|
||||
Reference in New Issue
Block a user