mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
* implement --loglevel option
This commit is contained in:
parent
2dae5bccb2
commit
a0e8fe5848
4 changed files with 24 additions and 5 deletions
13
Log.cpp
13
Log.cpp
|
@ -55,6 +55,19 @@ void Log::SetLogFile (const std::string& fullFilePath)
|
|||
delete logFile;
|
||||
}
|
||||
|
||||
void Log::SetLogLevel (const std::string& level)
|
||||
{
|
||||
if (level == "error") { m_MinLevel = eLogError; }
|
||||
else if (level == "warn") { m_MinLevel = eLogWarning; }
|
||||
else if (level == "info") { m_MinLevel = eLogInfo; }
|
||||
else if (level == "debug") { m_MinLevel = eLogDebug; }
|
||||
else {
|
||||
LogPrint(eLogError, "Log: Unknown loglevel: ", level);
|
||||
return;
|
||||
}
|
||||
LogPrint(eLogInfo, "Log: min msg level set to ", level);
|
||||
}
|
||||
|
||||
void Log::SetLogStream (std::ostream * logStream)
|
||||
{
|
||||
if (m_LogStream) delete m_LogStream;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue