mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Logging: Introduce logOnce helper
For cases where printing a message once is enough and to avoid spamming log.txt
This commit is contained in:
parent
bb88b5c36d
commit
3d0d987d89
@ -7,7 +7,7 @@ enum class LogType : sint32
|
|||||||
// note: IDs must be in range 1-64
|
// note: IDs must be in range 1-64
|
||||||
Force = 63, // always enabled
|
Force = 63, // always enabled
|
||||||
Placeholder = 62, // always disabled
|
Placeholder = 62, // always disabled
|
||||||
APIErrors = Force, // alias for Force. Logs bad parameters or other API errors in OS libs
|
APIErrors = Force, // alias for Force. Logs bad parameters or other API usage mistakes or unintended errors in OS libs
|
||||||
|
|
||||||
CoreinitFile = 0,
|
CoreinitFile = 0,
|
||||||
GX2 = 1,
|
GX2 = 1,
|
||||||
@ -99,6 +99,8 @@ bool cemuLog_log(LogType type, const T* format, TArgs&&... args)
|
|||||||
return cemuLog_log(type, format_str, std::forward<TArgs>(args)...);
|
return cemuLog_log(type, format_str, std::forward<TArgs>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define cemuLog_logOnce(...) { static bool _not_first_call = false; if (!_not_first_call) { _not_first_call = true; cemuLog_log(__VA_ARGS__); } }
|
||||||
|
|
||||||
// same as cemuLog_log, but only outputs in debug mode
|
// same as cemuLog_log, but only outputs in debug mode
|
||||||
template<typename TFmt, typename ... TArgs>
|
template<typename TFmt, typename ... TArgs>
|
||||||
bool cemuLog_logDebug(LogType type, TFmt format, TArgs&&... args)
|
bool cemuLog_logDebug(LogType type, TFmt format, TArgs&&... args)
|
||||||
|
Loading…
Reference in New Issue
Block a user