Updated logging

This commit is contained in:
Pasha Bibko
2025-07-20 14:50:50 +01:00
parent ac656b7b0f
commit f5bb46788c
3 changed files with 48 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ namespace LXC::Util
template<typename... Args> concept AllLogable = (Logable<Args> && ...);
// Enum to translate to the Win32 code for the colors //
enum class Color : WORD
enum Color : WORD
{
BLACK = 0x00,
BLUE = 0x01,
@@ -50,4 +50,23 @@ namespace LXC::Util
(std::cout << ... << args);
SetConsoleTextAttribute(hConsole, (WORD)Color::LIGHT_GRAY);
}
// Prints arguments to the console //
template<typename... Args>
requires AllLogable<Args...>
inline void Print(Args... args)
{
// Fowards the arguments to the console //
(std::cout << ... << args);
}
// Prints arguments to the console with a new-line character at the end //
template<typename... Args>
requires AllLogable<Args...>
inline void PrintLn(Args... args)
{
// Fowards the arguments to the console //
(std::cout << ... << args);
std::cout << std::endl;
}
}