SA_Logger
Sapphire's Suite's C++ Logger.
Loading...
Searching...
No Matches
Log.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 Sapphire's Suite. All Rights Reserved.
2
3#pragma once
4
5#ifndef SAPPHIRE_LOGGER_LOG_GUARD
6#define SAPPHIRE_LOGGER_LOG_GUARD
7
11
21namespace SA
22{
24 class Log
25 {
26 public:
28 std::wstring file;
29
31 uint32_t line = 0u;
32
34 std::string function;
35
37 std::wstring msg = L"Hello, World!";
38
40 LogLevel level = LogLevel::Normal;
41
43 std::wstring chanName = L"Default";
44
46 std::wstring details;
47
49 uint32_t frameNum = 0u;
50
52 std::string backtrace;
53
56
57
59 Log() = default;
60
75 std::wstring _file,
76 uint32_t _line,
77 std::string _function,
78 std::wstring _msg = L"Hello, World!",
79 LogLevel _level = LogLevel::Normal,
80 std::wstring _chanName = L"Default",
81 std::wstring _details = L"",
82 uint32_t _frameNum = 0u,
83 std::string _backtrace = ""
84 ) noexcept;
85 };
86
94 std::wstring ToWString(const Log& _log);
95}
96
97
100#endif // GUARD
Date Time definition.
Log level enum implementation.
LogLevel
All levels of logging.
Definition LogLevel.hpp:26
Definition of Sapphire ToString methods.
Log type implementation.
Definition Log.hpp:25
DateTime date
Date time.
Definition Log.hpp:55
uint32_t line
Line number.
Definition Log.hpp:31
std::wstring chanName
Output channel name.
Definition Log.hpp:43
std::string backtrace
backtracing of logging call.
Definition Log.hpp:52
std::string function
Function name.
Definition Log.hpp:34
std::wstring msg
User string message.
Definition Log.hpp:37
std::wstring file
File name.
Definition Log.hpp:28
Log(std::wstring _file, uint32_t _line, std::string _function, std::wstring _msg=L"Hello, World!", LogLevel _level=LogLevel::Normal, std::wstring _chanName=L"Default", std::wstring _details=L"", uint32_t _frameNum=0u, std::string _backtrace="") noexcept
Value Move Constructor.
uint32_t frameNum
Frame number.
Definition Log.hpp:49
Log()=default
Default constructor.
std::wstring details
Additional details string.
Definition Log.hpp:46
LogLevel level
Output level.
Definition Log.hpp:40
Date time structure type.
Definition DateTime.hpp:26