mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
sys: Merge splash screen and ImHex into one application
This fixes so many issues the previous implementation had, especially on Unix
This commit is contained in:
40
plugins/libimhex/include/hex/helpers/logger.hpp
Normal file
40
plugins/libimhex/include/hex/helpers/logger.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/color.h>
|
||||
|
||||
namespace hex::log {
|
||||
|
||||
void debug(std::string_view fmt, auto ... args) {
|
||||
#if defined(DEBUG)
|
||||
fmt::print(fg(fmt::color::green_yellow) | fmt::emphasis::bold, "[DEBUG] ");
|
||||
fmt::print(fmt, args...);
|
||||
fmt::print("\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
void info(std::string_view fmt, auto ... args) {
|
||||
fmt::print(fg(fmt::color::cadet_blue) | fmt::emphasis::bold, "[INFO] ");
|
||||
fmt::print(fmt, args...);
|
||||
fmt::print("\n");
|
||||
}
|
||||
|
||||
void warn(std::string_view fmt, auto ... args) {
|
||||
fmt::print(fg(fmt::color::light_golden_rod_yellow) | fmt::emphasis::bold, "[WARN] ");
|
||||
fmt::print(fmt, args...);
|
||||
fmt::print("\n");
|
||||
}
|
||||
|
||||
void error(std::string_view fmt, auto ... args) {
|
||||
fmt::print(fg(fmt::color::red) | fmt::emphasis::bold, "[ERROR] ");
|
||||
fmt::print(fmt, args...);
|
||||
fmt::print("\n");
|
||||
}
|
||||
|
||||
void fatal(std::string_view fmt, auto ... args) {
|
||||
fmt::print(fg(fmt::color::purple) | fmt::emphasis::bold, "[FATAL] ");
|
||||
fmt::print(fmt, args...);
|
||||
fmt::print("\n");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,6 +25,8 @@ namespace hex {
|
||||
|
||||
namespace prv { class Provider; }
|
||||
namespace dp { class Node; }
|
||||
namespace lang { class PatternData; }
|
||||
|
||||
class View;
|
||||
|
||||
class SharedData {
|
||||
@@ -58,6 +60,7 @@ namespace hex {
|
||||
static u32 patternPaletteOffset;
|
||||
static std::string errorPopupMessage;
|
||||
static std::list<ImHexApi::Bookmarks::Entry> bookmarkEntries;
|
||||
static std::vector<lang::PatternData*> patternData;
|
||||
|
||||
static std::map<std::string, std::string> languageNames;
|
||||
static std::map<std::string, std::vector<LanguageDefinition>> languageDefinitions;
|
||||
|
||||
Reference in New Issue
Block a user