8 template <
typename T>
struct noWrap {
11 T unwrap()
const {
return data; }
17 static_assert(
true,
"not supported wrapper for richLog");
21 strWrap(
const std::string& rhs);
22 const nchar* unwrap()
const;
26 template <
typename T,
bool Signed,
int Size>
27 using tifIntType =
typename std::enable_if<std::is_integral_v<T> ==
true && std::is_signed<T>{} == Signed &&
28 sizeof(T) * 8 == Size>::type;
30 template <
typename T> noWrap<T> __convert__(T rhs, tifIntType<T, true, 32>* =
nullptr) {
return rhs; }
32 template <
typename T> noWrap<T> __convert__(T rhs, tifIntType<T, true, 64>* =
nullptr) {
return rhs; }
34 template <
typename T> noWrap<T> __convert__(T rhs, tifIntType<T, false, 32>* =
nullptr) {
return rhs; }
36 template <
typename T> noWrap<T> __convert__(T rhs, tifIntType<T, false, 64>* =
nullptr) {
return rhs; }
38 _nout noWrap<nflt> __convert__(nflt rhs);
39 _nout noWrap<nflt> __convert__(nflt* rhs);
40 _nout noWrap<nchar> __convert__(nchar rhs);
41 _nout noWrap<nchar> __convert__(nchar rhs);
42 _nout strWrap __convert__(nbool rhs);
43 _nout strWrap __convert__(nbool rhs);
44 _nout noWrap<const nchar*> __convert__(
const nchar* rhs);
45 _nout noWrap<ndbl> __convert__(ndbl rhs);
46 _nout noWrap<ndbl> __convert__(ndbl rhs);
47 _nout noWrap<nshort> __convert__(nshort rhs);
48 _nout noWrap<nshort> __convert__(nshort rhs);
49 _nout noWrap<nushort> __convert__(nushort rhs);
50 _nout noWrap<nushort> __convert__(nushort rhs);
51 _nout strWrap __convert__(
const std::string* rhs);
52 _nout strWrap __convert__(
const std::string& rhs);
53 _nout strWrap __convert__(
void* rhs);
55 template <
typename... Ts>
56 void richLog(errLv::level lv,
const std::string& filename,
const nchar* func, nint line,
const nchar* fmt,
58 ::by::logger::get().log(lv, filename, func, line, fmt, __convert__((
const Ts&) args).unwrap()...);
61 template <
typename... Ts>
62 void dbgRichLog(errLv::level lv,
const std::string& filename,
const nchar* func, nint line,
const nchar* fmt,
65 ::by::logger::get().log(lv, filename, func, line, fmt, __convert__((
const Ts&) args).unwrap()...);
static logger & get()
Get singleton logger instance.
Definition: richLog.hpp:8
Definition: richLog.hpp:20
Definition: richLog.hpp:16