mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-23 05:31:03 +00:00
The event manager forms the basis for semantic logging. The emulator transmits events and the manager can handle them. This means to either print information to stdout, do nothing, etc...
29 lines
903 B
C++
29 lines
903 B
C++
#pragma once
|
|
#include "generic_logger.hpp"
|
|
|
|
class logger : public generic_logger
|
|
{
|
|
public:
|
|
void print(color c, std::string_view message) override;
|
|
void print(color c, const char* message, ...) override FORMAT_ATTRIBUTE(3, 4);
|
|
void info(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
|
void warn(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
|
void error(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
|
void success(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
|
void log(const char* message, ...) const FORMAT_ATTRIBUTE(2, 3);
|
|
|
|
void disable_output(const bool value)
|
|
{
|
|
this->disable_output_ = value;
|
|
}
|
|
|
|
bool is_output_disabled() const
|
|
{
|
|
return this->disable_output_;
|
|
}
|
|
|
|
private:
|
|
bool disable_output_{false};
|
|
void print_message(color c, std::string_view message, bool force = false) const;
|
|
};
|