@@ -76,21 +76,28 @@ auto ForwardEnum(std::tuple<TArgs...> t)
76
76
}
77
77
78
78
template <typename T, typename ... TArgs>
79
- bool cemuLog_log (LogType type, std::basic_string<T> format , TArgs&&... args)
79
+ bool cemuLog_log (LogType type, std::basic_string<T> formatStr , TArgs&&... args)
80
80
{
81
81
if (!cemuLog_isLoggingEnabled (type))
82
82
return false ;
83
-
84
- const auto format_view = fmt::basic_string_view<T>(format);
85
- const auto text = fmt::vformat (format_view, fmt::make_format_args<fmt::buffer_context<T>>(ForwardEnum (args)...));
86
- cemuLog_log (type, std::basic_string_view (text.data (), text.size ()));
83
+ if constexpr (sizeof ...(TArgs) == 0 )
84
+ {
85
+ cemuLog_log (type, std::basic_string_view<T>(formatStr.data (), formatStr.size ()));
86
+ return true ;
87
+ }
88
+ else
89
+ {
90
+ const auto format_view = fmt::basic_string_view<T>(formatStr);
91
+ const auto text = fmt::vformat (format_view, fmt::make_format_args<fmt::buffer_context<T>>(ForwardEnum (args)...));
92
+ cemuLog_log (type, std::basic_string_view (text.data (), text.size ()));
93
+ }
87
94
return true ;
88
95
}
89
96
90
97
template <typename T, typename ... TArgs>
91
98
bool cemuLog_log (LogType type, const T* format, TArgs&&... args)
92
99
{
93
- auto format_str= std::basic_string<T>(format);
100
+ auto format_str = std::basic_string<T>(format);
94
101
return cemuLog_log (type, format_str, std::forward<TArgs>(args)...);
95
102
}
96
103
0 commit comments