Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
Logger.hpp File Reference
#include <string>
#include <iostream>
#include <sstream>
#include <mutex>
Include dependency graph for Logger.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  utils::Logger
 

Namespaces

namespace  utils
 

Macros

#define LOG_DEBUG(msg)   do { if (utils::Logger::current_level <= utils::LogLevel::DEBUG) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::DEBUG, __FILE__, __LINE__, oss.str()); } } while(0)
 
#define LOG_INFO(msg)   do { if (utils::Logger::current_level <= utils::LogLevel::INFO) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::INFO, __FILE__, __LINE__, oss.str()); } } while(0)
 
#define LOG_WARN(msg)   do { if (utils::Logger::current_level <= utils::LogLevel::WARN) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::WARN, __FILE__, __LINE__, oss.str()); } } while(0)
 
#define LOG_ERROR(msg)   do { if (utils::Logger::current_level <= utils::LogLevel::ERROR) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::ERROR, __FILE__, __LINE__, oss.str()); } } while(0)
 

Enumerations

enum class  utils::LogLevel { utils::DEBUG = 0 , utils::INFO = 1 , utils::WARN = 2 , utils::ERROR = 3 }
 

Macro Definition Documentation

◆ LOG_DEBUG

#define LOG_DEBUG (   msg)    do { if (utils::Logger::current_level <= utils::LogLevel::DEBUG) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::DEBUG, __FILE__, __LINE__, oss.str()); } } while(0)

◆ LOG_ERROR

#define LOG_ERROR (   msg)    do { if (utils::Logger::current_level <= utils::LogLevel::ERROR) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::ERROR, __FILE__, __LINE__, oss.str()); } } while(0)

◆ LOG_INFO

#define LOG_INFO (   msg)    do { if (utils::Logger::current_level <= utils::LogLevel::INFO) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::INFO, __FILE__, __LINE__, oss.str()); } } while(0)

◆ LOG_WARN

#define LOG_WARN (   msg)    do { if (utils::Logger::current_level <= utils::LogLevel::WARN) { std::ostringstream oss; oss << msg; utils::Logger::log(utils::LogLevel::WARN, __FILE__, __LINE__, oss.str()); } } while(0)