Core/Logging: Improved generated code for log statements (length of text is computed at compile time)

This commit is contained in:
Shauren
2024-03-15 20:46:10 +01:00
parent 783f9c0ea3
commit e121ed81d1
4 changed files with 46 additions and 37 deletions

View File

@@ -22,11 +22,11 @@
#include "Log.h"
#include "Player.h"
#define TC_LOG_CHAT(TYPE, ...) \
if (lang != LANG_ADDON && lang != LANG_ADDON_LOGGED) \
TC_LOG_DEBUG("chat.log." TYPE, __VA_ARGS__); \
else \
TC_LOG_DEBUG("chat.log.addon." TYPE, __VA_ARGS__);
#define TC_LOG_CHAT(TYPE, MESSAGE, ...) \
if (lang != LANG_ADDON && lang != LANG_ADDON_LOGGED) \
TC_LOG_DEBUG("chat.log." TYPE, MESSAGE, __VA_ARGS__); \
else \
TC_LOG_DEBUG("chat.log.addon." TYPE, MESSAGE, __VA_ARGS__);
class ChatLogScript : public PlayerScript
{