1
0
mirror of synced 2024-12-13 00:11:06 +01:00
ImHex/plugins/libimhex/include/hex/helpers/logger.hpp
WerWolv e74c0f5cf5 sys: Tons of long overdue cleanup
- std::string -> const std::string& where needed
- Added a FileIO abstraction class
- Fixed recent files not updating
- Removed localization file from global include
- Renamed lang to pattern_language/pl
- Renamed EventFileDropped to RequestFileOpen
2021-09-08 15:18:24 +02:00

40 lines
1.2 KiB
C++

#pragma once
#include <fmt/core.h>
#include <fmt/color.h>
namespace hex::log {
void debug(const std::string &fmt, auto ... args) {
#if defined(DEBUG)
fmt::print(fg(fmt::color::green_yellow) | fmt::emphasis::bold, "[DEBUG] ");
fmt::print(fmt::runtime(fmt), args...);
fmt::print("\n");
#endif
}
void info(const std::string &fmt, auto ... args) {
fmt::print(fg(fmt::color::cadet_blue) | fmt::emphasis::bold, "[INFO] ");
fmt::print(fmt::runtime(fmt), args...);
fmt::print("\n");
}
void warn(const std::string &fmt, auto ... args) {
fmt::print(fg(fmt::color::light_golden_rod_yellow) | fmt::emphasis::bold, "[WARN] ");
fmt::print(fmt::runtime(fmt), args...);
fmt::print("\n");
}
void error(const std::string &fmt, auto ... args) {
fmt::print(fg(fmt::color::red) | fmt::emphasis::bold, "[ERROR] ");
fmt::print(fmt::runtime(fmt), args...);
fmt::print("\n");
}
void fatal(const std::string &fmt, auto ... args) {
fmt::print(fg(fmt::color::purple) | fmt::emphasis::bold, "[FATAL] ");
fmt::print(fmt::runtime(fmt), args...);
fmt::print("\n");
}
}