Mandrill 2025.6.0
Loading...
Searching...
No Matches
Log.h
1#pragma once
2
3#include "Common.h"
4
5namespace Mandrill
6{
10 class MANDRILL_API Log
11 {
12 public:
13 enum class Level {
14 Info,
15 Debug,
16 Warning,
17 Error,
18 Count,
19 };
20
21 static void log(Level level, const std::string msg);
22
29 template <typename... Args> inline static void Info(std::format_string<Args...> format, Args&&... args)
30 {
31 log(Level::Info, std::format(format, std::forward<Args>(args)...));
32 }
33
40 template <typename... Args> inline static void Debug(std::format_string<Args...> format, Args&&... args)
41 {
42#ifdef _DEBUG
43 log(Level::Debug, std::format(format, std::forward<Args>(args)...));
44#endif
45 }
46
53 template <typename... Args> inline static void Warning(std::format_string<Args...> format, Args&&... args)
54 {
55 log(Level::Warning, std::format(format, std::forward<Args>(args)...));
56 }
57
64 template <typename... Args> inline static void Error(std::format_string<Args...> format, Args&&... args)
65 {
66 log(Level::Error, std::format(format, std::forward<Args>(args)...));
67 }
68 };
69
70} // namespace Mandrill
Log class for logging messages in Mandrill.
Definition Log.h:11
static void Debug(std::format_string< Args... > format, Args &&... args)
Log a debug message using format strings. This does not print message in release mode.
Definition Log.h:40
static void Info(std::format_string< Args... > format, Args &&... args)
Log an information message using format strings.
Definition Log.h:29
static void Warning(std::format_string< Args... > format, Args &&... args)
Log a warning message using format strings.
Definition Log.h:53
static void Error(std::format_string< Args... > format, Args &&... args)
Log an error message using format strings.
Definition Log.h:64