Vyroda
Game engine made by hand, with modern C++ and Vulkan.
Loading...
Searching...
No Matches
Logger.cppm
Go to the documentation of this file.
1module;
2
3#include <fmt/color.h>
4#include <fmt/chrono.h>
5#include <fmt/core.h>
6
7export module Engine.Core.Logger;
8
9import std;
10
11namespace Vyroda
12{
13 export class Logger
14 {
15 public:
16
17 template <typename... Args>
18 static void critical(fmt::format_string<Args...> fmt_str, Args&&... args)
19 {
20 fmt::print(
21 fg(fmt::color::red) | fmt::emphasis::bold,
22 fmt_str,
23 std::forward<Args>(args)...);
24 fmt::print("\n");
25 }
26
27 template <typename... Args>
28 static void error(fmt::format_string<Args...> fmt_str, Args&&... args)
29 {
30 fmt::print(
31 fg(fmt::color::red) | fmt::emphasis::bold,
32 fmt_str,
33 std::forward<Args>(args)...);
34 fmt::print("\n");
35 }
36
37 template <typename... Args>
38 static void warn(fmt::format_string<Args...> fmt_str, Args&&... args)
39 {
40 fmt::print(
41 fg(fmt::color::orange),
42 fmt_str,
43 std::forward<Args>(args)...);
44 fmt::print("\n");
45 }
46
47 template <typename... Args>
48 static void info(fmt::format_string<Args...> fmt_str, Args&&... args)
49 {
50 fmt::print(
51 fg(fmt::color::white),
52 fmt_str,
53 std::forward<Args>(args)...);
54 fmt::print("\n");
55 }
56
57 template <typename... Args>
58 static void debug(fmt::format_string<Args...> fmt_str, Args&&... args)
59 {
60 fmt::print(
61 fg(fmt::color::green),
62 fmt_str,
63 std::forward<Args>(args)...);
64 fmt::print("\n");
65 }
66
67 template <typename... Args>
68 static void trace(fmt::format_string<Args...> fmt_str, Args&&... args)
69 {
70 fmt::print(
71 fg(fmt::color::white),
72 fmt_str,
73 std::forward<Args>(args)...);
74 fmt::print("\n");
75 }
76 };
77}
Definition Logger.cppm:14
static void info(fmt::format_string< Args... > fmt_str, Args &&... args)
Definition Logger.cppm:48
static void trace(fmt::format_string< Args... > fmt_str, Args &&... args)
Definition Logger.cppm:68
static void debug(fmt::format_string< Args... > fmt_str, Args &&... args)
Definition Logger.cppm:58
static void error(fmt::format_string< Args... > fmt_str, Args &&... args)
Definition Logger.cppm:28
static void critical(fmt::format_string< Args... > fmt_str, Args &&... args)
Definition Logger.cppm:18
static void warn(fmt::format_string< Args... > fmt_str, Args &&... args)
Definition Logger.cppm:38
Definition EditorManager.cpp:29