PLaSK library

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
plask::Logger Class Referenceabstract

Abstract class that is base for all loggers. More...

`#include <plask/log/log.hpp>`

Inheritance diagram for plask::Logger:
[legend]
Collaboration diagram for plask::Logger:
[legend]

## Public Types
enum | ColorMode { COLOR_NONE , COLOR_ANSI }

## Public Member Functions
| Logger ()
virtual | ~Logger ()
virtual void | writelog (LogLevel level, const std::string &msg)=0
| Log a message.

## Public Attributes
ColorMode | color
| Log coloring mode.

## Protected Attributes
std::string | prefix
| Prefix to add to every log line.

## Friends
class | NoLogging
void | writelog (LogLevel level, const std::string &msg)
| Log a message.
template<typename... Args>
void | writelog (LogLevel level, const std::string &msg, Args &&... params)
| Log a message.

## Detailed Description

Abstract class that is base for all loggers.

Definition at line 68 of file log.hpp.

## Member Enumeration Documentation

## ◆ ColorMode

enum plask::Logger::ColorMode

Enumerator
COLOR_NONE |
COLOR_ANSI |

Definition at line 87 of file log.hpp.

## Constructor & Destructor Documentation

## ◆ Logger()

plask::Logger::Logger | ( |  | ) |

Definition at line 53 of file log.cpp.

## ◆ ~Logger()

virtual plask::Logger::~Logger | ( |  | ) |
| inline virtual

Definition at line 100 of file log.hpp.

## Member Function Documentation

## ◆ writelog()

virtual void plask::Logger::writelog | ( | LogLevel | level,
|  | const std::string & | msg
| ) |  |
| pure virtual

Log a message.

Parameters

  level | log level to log
  msg | log message

Implemented in plask::StderrLogger.

## Friends And Related Symbol Documentation

## ◆ NoLogging

friend class NoLogging
| friend

Definition at line 73 of file log.hpp.

## ◆ writelog [1/2]

void writelog | ( | LogLevel | level,
|  | const std::string & | msg
| ) |  |
| friend

Log a message.

Parameters

  level | log level to log
  msg | log message

Definition at line 123 of file log.hpp.

## ◆ writelog [2/2]

template<typename... Args>

void writelog | ( | LogLevel | level,
|  | const std::string & | msg,
|  | Args &&... | params
| ) |  |
| friend

Log a message.

Parameters

  level | log level to log
  msg | log message
  params | parameters passed to format

Definition at line 137 of file log.hpp.

## Member Data Documentation

## ◆ color

ColorMode plask::Logger::color

Log coloring mode.

Definition at line 96 of file log.hpp.

## ◆ prefix

std::string plask::Logger::prefix
| protected

Prefix to add to every log line.

Definition at line 83 of file log.hpp.

The documentation for this class was generated from the following files:

- plask/log/log.hpp
- plask/log/log.cpp