@@ -14,12 +14,20 @@ namespace REX
1414
1515 void LOG (const std::source_location a_loc, const LOG_LEVEL a_level, const std::string_view a_fmt);
1616
17+ void LOG (const std::source_location a_loc, const LOG_LEVEL a_level, const std::wstring_view a_fmt);
18+
1719 template <class ... T>
1820 void LOG (const std::source_location a_loc, const LOG_LEVEL a_level, const std::format_string<T...> a_fmt, T&&... a_args)
1921 {
2022 LOG (a_loc, a_level, std::vformat (a_fmt.get (), std::make_format_args (a_args...)));
2123 }
2224
25+ template <class ... T>
26+ void LOG (const std::source_location a_loc, const LOG_LEVEL a_level, const std::wformat_string<T...> a_fmt, T&&... a_args)
27+ {
28+ LOG (a_loc, a_level, std::vformat (a_fmt.get (), std::make_wformat_args (a_args...)));
29+ }
30+
2331 template <class ... T>
2432 struct TRACE
2533 {
@@ -29,6 +37,11 @@ namespace REX
2937 {
3038 LOG (a_loc, LOG_LEVEL::TRACE, a_fmt, std::forward<T>(a_args)...);
3139 }
40+
41+ explicit TRACE (const std::wformat_string<T...> a_fmt, T&&... a_args, const std::source_location a_loc = std::source_location::current())
42+ {
43+ LOG (a_loc, LOG_LEVEL::TRACE, a_fmt, std::forward<T>(a_args)...);
44+ }
3245 };
3346
3447 template <>
@@ -40,6 +53,11 @@ namespace REX
4053 {
4154 LOG (a_loc, LOG_LEVEL::TRACE, a_fmt);
4255 }
56+
57+ explicit TRACE (const std::wstring_view a_fmt, const std::source_location a_loc = std::source_location::current())
58+ {
59+ LOG (a_loc, LOG_LEVEL::TRACE, a_fmt);
60+ }
4361 };
4462
4563 template <class ... T>
@@ -51,6 +69,11 @@ namespace REX
5169 {
5270 LOG (a_loc, LOG_LEVEL::DEBUG, a_fmt, std::forward<T>(a_args)...);
5371 }
72+
73+ explicit DEBUG (const std::wformat_string<T...> a_fmt, T&&... a_args, const std::source_location a_loc = std::source_location::current())
74+ {
75+ LOG (a_loc, LOG_LEVEL::DEBUG, a_fmt, std::forward<T>(a_args)...);
76+ }
5477 };
5578
5679 template <>
@@ -62,6 +85,11 @@ namespace REX
6285 {
6386 LOG (a_loc, LOG_LEVEL::DEBUG, a_fmt);
6487 }
88+
89+ explicit DEBUG (const std::wstring_view a_fmt, const std::source_location a_loc = std::source_location::current())
90+ {
91+ LOG (a_loc, LOG_LEVEL::DEBUG, a_fmt);
92+ }
6593 };
6694
6795 template <class ... T>
@@ -73,6 +101,11 @@ namespace REX
73101 {
74102 LOG (a_loc, LOG_LEVEL::INFO, a_fmt, std::forward<T>(a_args)...);
75103 }
104+
105+ explicit INFO (const std::wformat_string<T...> a_fmt, T&&... a_args, const std::source_location a_loc = std::source_location::current())
106+ {
107+ LOG (a_loc, LOG_LEVEL::INFO, a_fmt, std::forward<T>(a_args)...);
108+ }
76109 };
77110
78111 template <>
@@ -84,6 +117,11 @@ namespace REX
84117 {
85118 LOG (a_loc, LOG_LEVEL::INFO, a_fmt);
86119 }
120+
121+ explicit INFO (const std::wstring_view a_fmt, const std::source_location a_loc = std::source_location::current())
122+ {
123+ LOG (a_loc, LOG_LEVEL::INFO, a_fmt);
124+ }
87125 };
88126
89127 template <class ... T>
@@ -95,6 +133,11 @@ namespace REX
95133 {
96134 LOG (a_loc, LOG_LEVEL::WARN, a_fmt, std::forward<T>(a_args)...);
97135 }
136+
137+ explicit WARN (const std::wformat_string<T...> a_fmt, T&&... a_args, const std::source_location a_loc = std::source_location::current())
138+ {
139+ LOG (a_loc, LOG_LEVEL::WARN, a_fmt, std::forward<T>(a_args)...);
140+ }
98141 };
99142
100143 template <>
@@ -106,6 +149,11 @@ namespace REX
106149 {
107150 LOG (a_loc, LOG_LEVEL::WARN, a_fmt);
108151 }
152+
153+ explicit WARN (const std::wstring_view a_fmt, const std::source_location a_loc = std::source_location::current())
154+ {
155+ LOG (a_loc, LOG_LEVEL::WARN, a_fmt);
156+ }
109157 };
110158
111159 template <class ... T>
@@ -117,6 +165,11 @@ namespace REX
117165 {
118166 LOG (a_loc, LOG_LEVEL::ERROR, a_fmt, std::forward<T>(a_args)...);
119167 }
168+
169+ explicit ERROR (const std::wformat_string<T...> a_fmt, T&&... a_args, const std::source_location a_loc = std::source_location::current())
170+ {
171+ LOG (a_loc, LOG_LEVEL::ERROR, a_fmt, std::forward<T>(a_args)...);
172+ }
120173 };
121174
122175 template <>
@@ -128,6 +181,11 @@ namespace REX
128181 {
129182 LOG (a_loc, LOG_LEVEL::ERROR, a_fmt);
130183 }
184+
185+ explicit ERROR (const std::wstring_view a_fmt, const std::source_location a_loc = std::source_location::current())
186+ {
187+ LOG (a_loc, LOG_LEVEL::ERROR, a_fmt);
188+ }
131189 };
132190
133191 template <class ... T>
@@ -139,6 +197,11 @@ namespace REX
139197 {
140198 LOG (a_loc, LOG_LEVEL::CRITICAL, a_fmt, std::forward<T>(a_args)...);
141199 }
200+
201+ explicit CRITICAL (const std::wformat_string<T...> a_fmt, T&&... a_args, const std::source_location a_loc = std::source_location::current())
202+ {
203+ LOG (a_loc, LOG_LEVEL::CRITICAL, a_fmt, std::forward<T>(a_args)...);
204+ }
142205 };
143206
144207 template <>
@@ -150,29 +213,52 @@ namespace REX
150213 {
151214 LOG (a_loc, LOG_LEVEL::CRITICAL, a_fmt);
152215 }
216+
217+ explicit CRITICAL (const std::wstring_view a_fmt, const std::source_location a_loc = std::source_location::current())
218+ {
219+ LOG (a_loc, LOG_LEVEL::CRITICAL, a_fmt);
220+ }
153221 };
154222
155223 template <class ... T>
156224 TRACE (const std::format_string<T...>, T&&...) -> TRACE<T...>;
225+ template <class ... T>
226+ TRACE (const std::wformat_string<T...>, T&&...) -> TRACE<T...>;
157227 TRACE (const std::string_view) -> TRACE<void >;
228+ TRACE (const std::wstring_view) -> TRACE<void >;
158229
159230 template <class ... T>
160231 DEBUG (const std::format_string<T...>, T&&...) -> DEBUG<T...>;
232+ template <class ... T>
233+ DEBUG (const std::wformat_string<T...>, T&&...) -> DEBUG<T...>;
161234 DEBUG (const std::string_view) -> DEBUG<void >;
235+ DEBUG (const std::wstring_view) -> DEBUG<void >;
162236
163237 template <class ... T>
164238 INFO (const std::format_string<T...>, T&&...) -> INFO<T...>;
239+ template <class ... T>
240+ INFO (const std::wformat_string<T...>, T&&...) -> INFO<T...>;
165241 INFO (const std::string_view) -> INFO<void >;
242+ INFO (const std::wstring_view) -> INFO<void >;
166243
167244 template <class ... T>
168245 WARN (const std::format_string<T...>, T&&...) -> WARN<T...>;
246+ template <class ... T>
247+ WARN (const std::wformat_string<T...>, T&&...) -> WARN<T...>;
169248 WARN (const std::string_view) -> WARN<void >;
249+ WARN (const std::wstring_view) -> WARN<void >;
170250
171251 template <class ... T>
172252 ERROR (const std::format_string<T...>, T&&...) -> ERROR<T...>;
253+ template <class ... T>
254+ ERROR (const std::wformat_string<T...>, T&&...) -> ERROR<T...>;
173255 ERROR (const std::string_view) -> ERROR<void >;
256+ ERROR (const std::wstring_view) -> ERROR<void >;
174257
175258 template <class ... T>
176259 CRITICAL (const std::format_string<T...>, T&&...) -> CRITICAL<T...>;
260+ template <class ... T>
261+ CRITICAL (const std::wformat_string<T...>, T&&...) -> CRITICAL<T...>;
177262 CRITICAL (const std::string_view) -> CRITICAL<void >;
263+ CRITICAL (const std::wstring_view) -> CRITICAL<void >;
178264}
0 commit comments