Silicon
A realtime platform for creating interactive media.
Log.hpp
Go to the documentation of this file.
1// BSD 2-Clause License
2//
3// Copyright (c) 2022, Matthew McCall
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are met:
8//
9// 1. Redistributions of source code must retain the above copyright notice, this
10// list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright notice,
13// this list of conditions and the following disclaimer in the documentation
14// and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27#ifndef SILICON_LOG_HPP
28#define SILICON_LOG_HPP
29
30#include "spdlog/logger.h"
31
32namespace Si {
33
34namespace Log {
35
37
39}
40
41template <typename... Args>
42void Trace(Args&&... args)
43{
44 Log::GetClientLogger()->trace(std::forward<Args>(args)...);
45}
46
47template <typename... Args>
48void Info(Args&&... args)
49{
50 Log::GetClientLogger()->info(std::forward<Args>(args)...);
51}
52
53template <typename... Args>
54void Debug(Args&&... args)
55{
56 Log::GetClientLogger()->debug(std::forward<Args>(args)...);
57}
58
59template <typename... Args>
60void Warn(Args&&... args)
61{
62 Log::GetClientLogger()->warn(std::forward<Args>(args)...);
63}
64
65template <typename... Args>
66void Error(Args&&... args)
67{
68 Log::GetClientLogger()->error(std::forward<Args>(args)...);
69}
70
71template <typename... Args>
72void Critical(Args&&... args)
73{
74 Log::GetClientLogger()->critical(std::forward<Args>(args)...);
75}
76
77namespace Engine {
78 template <typename... Args>
79 void Trace(Args&&... args)
80 {
81 Log::GetEngineLogger()->trace(std::forward<Args>(args)...);
82 }
83
84 template <typename... Args>
85 void Info(Args&&... args)
86 {
87 Log::GetEngineLogger()->info(std::forward<Args>(args)...);
88 }
89
90 template <typename... Args>
91 void Debug(Args&&... args)
92 {
93 Log::GetEngineLogger()->debug(std::forward<Args>(args)...);
94 }
95
96 template <typename... Args>
97 void Warn(Args&&... args)
98 {
99 Log::GetEngineLogger()->warn(std::forward<Args>(args)...);
100 }
101
102 template <typename... Args>
103 void Error(Args&&... args)
104 {
105 Log::GetEngineLogger()->error(std::forward<Args>(args)...);
106 }
107
108 template <typename... Args>
109 void Critical(Args&&... args)
110 {
111 Log::GetEngineLogger()->critical(std::forward<Args>(args)...);
112 }
113}
114}
115
116#endif // SILICON_LOG_HPP
void Error(Args &&... args)
Definition: Log.hpp:103
void Info(Args &&... args)
Definition: Log.hpp:85
void Critical(Args &&... args)
Definition: Log.hpp:109
void Trace(Args &&... args)
Definition: Log.hpp:79
void Debug(Args &&... args)
Definition: Log.hpp:91
void Warn(Args &&... args)
Definition: Log.hpp:97
std::shared_ptr< spdlog::logger > GetEngineLogger()
Definition: Log.cpp:94
std::shared_ptr< spdlog::logger > GetClientLogger()
Definition: Log.cpp:99
Definition: Allocator.hpp:36
void Info(Args &&... args)
Definition: Log.hpp:48
void Error(Args &&... args)
Definition: Log.hpp:66
void Debug(Args &&... args)
Definition: Log.hpp:54
void Critical(Args &&... args)
Definition: Log.hpp:72
void Trace(Args &&... args)
Definition: Log.hpp:42
void Warn(Args &&... args)
Definition: Log.hpp:60