Commit 2bd1418d authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Add a Verbose log level, keep Debug for our own logs

parent f764a862
......@@ -31,4 +31,5 @@ public:
virtual void Error( const std::string& msg ) = 0;
virtual void Warning( const std::string& msg ) = 0;
virtual void Info( const std::string& msg ) = 0;
virtual void Debug( const std::string& msg ) = 0;
};
......@@ -57,8 +57,9 @@ typedef SqliteConnection* DBConnection;
enum class LogLevel
{
/// Debug: Extra logs (currently used by to enable third parties logs
/// Verbose: Extra logs (currently used by to enable third parties logs
/// such as VLC)
Verbose,
Debug,
Info,
Warning,
......
......@@ -42,4 +42,9 @@ public:
{
std::cout << "Info: " << msg;
}
virtual void Debug(const std::string& msg) override
{
std::cout << "Debug: " << msg;
}
};
......@@ -73,10 +73,13 @@ private:
case LogLevel::Warning:
l->Warning( msg );
break;
case LogLevel::Debug:
case LogLevel::Info:
l->Info( msg );
break;
case LogLevel::Verbose:
case LogLevel::Debug:
l->Debug( msg );
break;
}
}
......@@ -109,6 +112,12 @@ public:
log( LogLevel::Info, std::forward<Args>( args )... );
}
template <typename... Args>
static void Debug( Args... args )
{
log( LogLevel::Debug, std::forward<Args>( args )... );
}
private:
private:
......@@ -128,3 +137,4 @@ private:
#define LOG_ERROR( ... ) Log::Error( LOG_ORIGIN, ' ', __VA_ARGS__ )
#define LOG_WARN( ... ) Log::Warning( LOG_ORIGIN, ' ', __VA_ARGS__ )
#define LOG_INFO( ... ) Log::Info( LOG_ORIGIN, ' ', __VA_ARGS__ )
#define LOG_DEBUG( ... ) Log::Debug( LOG_ORIGIN, ' ', __VA_ARGS__ )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment