add logger.print
This commit is contained in:
parent
3d7a9fd225
commit
3d6c1183c4
@ -23,10 +23,16 @@ Logger::Logger(std::string name) : name(std::move(name)) {
|
||||
void Logger::log(
|
||||
LogLevel level, const std::string& name, const std::string& message
|
||||
) {
|
||||
if (level == LogLevel::print) {
|
||||
std::cout << "[" << name << "] " << message << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
std::stringstream ss;
|
||||
switch (level) {
|
||||
case LogLevel::print:
|
||||
case LogLevel::debug:
|
||||
#ifdef NDEBUG
|
||||
return;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include <sstream>
|
||||
|
||||
namespace debug {
|
||||
enum class LogLevel { debug, info, warning, error };
|
||||
enum class LogLevel { print, debug, info, warning, error };
|
||||
|
||||
class Logger;
|
||||
|
||||
@ -60,5 +60,10 @@ namespace debug {
|
||||
LogMessage warning() {
|
||||
return LogMessage(this, LogLevel::warning);
|
||||
}
|
||||
|
||||
/// @brief Print-debugging tool (printed without header)
|
||||
LogMessage print() {
|
||||
return LogMessage(this, LogLevel::print);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user