mirror of
https://github.com/momo5502/emulator.git
synced 2026-02-01 19:15:23 +01:00
Prepare event manager
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...
This commit is contained in:
28
src/windows-emulator/generic_logger.hpp
Normal file
28
src/windows-emulator/generic_logger.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include <utils/object.hpp>
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#define FORMAT_ATTRIBUTE(fmt_pos, var_pos) __attribute__((format(printf, fmt_pos, var_pos)))
|
||||
#else
|
||||
#define FORMAT_ATTRIBUTE(fmt_pos, var_pos)
|
||||
#endif
|
||||
|
||||
enum class color
|
||||
{
|
||||
black,
|
||||
red,
|
||||
green,
|
||||
yellow,
|
||||
blue,
|
||||
cyan,
|
||||
pink,
|
||||
white,
|
||||
gray,
|
||||
dark_gray,
|
||||
};
|
||||
|
||||
struct generic_logger : utils::object
|
||||
{
|
||||
virtual void print(color c, std::string_view message) = 0;
|
||||
virtual void print(color c, const char* message, ...) FORMAT_ATTRIBUTE(3, 4) = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user