DESERT 3.5.1
Loading...
Searching...
No Matches
logging.h File Reference
#include <iostream>
#include <string_view>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ConsoleColours
 

Macros

#define LOG_MSG(color, msg)   std::cout << color << msg << ConsoleColours::Reset << std::endl;
 
#define LOG_MSG_ONCE(color, msg)
 
#define LOG_MSG_INFO(msg)   LOG_MSG(ConsoleColours::Green, msg)
 
#define LOG_MSG_WARN(msg)   LOG_MSG(ConsoleColours::Yellow, msg)
 
#define LOG_MSG_ERROR(msg)   LOG_MSG(ConsoleColours::Red, msg)
 
#define LOG_MSG_INFO_ONCE(msg)   LOG_MSG_ONCE(ConsoleColours::Green, msg)
 
#define LOG_MSG_WARN_ONCE(msg)   LOG_MSG_ONCE(ConsoleColours::Yellow, msg)
 
#define LOG_MSG_ERROR_ONCE(msg)   LOG_MSG_ONCE(ConsoleColours::Red, msg)
 

Variables

constexpr std::string_view ConsoleColours::Red = "\x1b[1;31m"
 
constexpr std::string_view ConsoleColours::Green = "\x1b[1;32m"
 
constexpr std::string_view ConsoleColours::Yellow = "\x1b[1;33m"
 
constexpr std::string_view ConsoleColours::Blue = "\x1b[1;34m"
 
constexpr std::string_view ConsoleColours::Magenta = "\x1b[1;35m"
 
constexpr std::string_view ConsoleColours::Cyan = "\x1b[1;36m"
 
constexpr std::string_view ConsoleColours::Reset = "\x1b[0m"
 

Detailed Description

Provides the definition of PositionData struct.

Author
Torsten Pfuetzenreuter
Version
1.0.0

Definition in file logging.h.

Macro Definition Documentation

◆ LOG_MSG

#define LOG_MSG (   color,
  msg 
)    std::cout << color << msg << ConsoleColours::Reset << std::endl;

Definition at line 63 of file logging.h.

◆ LOG_MSG_ERROR

#define LOG_MSG_ERROR (   msg)    LOG_MSG(ConsoleColours::Red, msg)

Definition at line 77 of file logging.h.

◆ LOG_MSG_ERROR_ONCE

#define LOG_MSG_ERROR_ONCE (   msg)    LOG_MSG_ONCE(ConsoleColours::Red, msg)

Definition at line 81 of file logging.h.

◆ LOG_MSG_INFO

#define LOG_MSG_INFO (   msg)    LOG_MSG(ConsoleColours::Green, msg)

Definition at line 75 of file logging.h.

◆ LOG_MSG_INFO_ONCE

#define LOG_MSG_INFO_ONCE (   msg)    LOG_MSG_ONCE(ConsoleColours::Green, msg)

Definition at line 79 of file logging.h.

◆ LOG_MSG_ONCE

#define LOG_MSG_ONCE (   color,
  msg 
)
Value:
{ \
static bool msg_shown = false; \
if (!msg_shown) \
{ \
msg_shown = true; \
LOG_MSG(color, msg) \
} \
}

Definition at line 65 of file logging.h.

◆ LOG_MSG_WARN

#define LOG_MSG_WARN (   msg)    LOG_MSG(ConsoleColours::Yellow, msg)

Definition at line 76 of file logging.h.

◆ LOG_MSG_WARN_ONCE

#define LOG_MSG_WARN_ONCE (   msg)    LOG_MSG_ONCE(ConsoleColours::Yellow, msg)

Definition at line 80 of file logging.h.