mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 08:15:46 -05:00
Add log level to log executed macros
This commit is contained in:
@@ -12,9 +12,15 @@ bool VerboseLoggingEnabled()
|
||||
bool ActionLoggingEnabled()
|
||||
{
|
||||
return GetSwitcher() &&
|
||||
(GetSwitcher()->logLevel ==
|
||||
SwitcherData::LogLevel::PRINT_ACTION ||
|
||||
GetSwitcher()->logLevel == SwitcherData::LogLevel::VERBOSE);
|
||||
(GetSwitcher()->logLevel == SwitcherData::LogLevel::LOG_ACTION ||
|
||||
VerboseLoggingEnabled());
|
||||
}
|
||||
|
||||
bool MacroLoggingEnabled()
|
||||
{
|
||||
return GetSwitcher() &&
|
||||
(GetSwitcher()->logLevel == SwitcherData::LogLevel::LOG_MACRO ||
|
||||
ActionLoggingEnabled());
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -27,6 +27,13 @@ namespace advss {
|
||||
blog(level, msg, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
// Print log with "[adv-ss] " if log level is set to "macro", "action" or "verbose"
|
||||
#define mblog(level, msg, ...) \
|
||||
do { \
|
||||
if (MacroLoggingEnabled()) { \
|
||||
blog(level, msg, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,5 +41,7 @@ namespace advss {
|
||||
EXPORT bool VerboseLoggingEnabled();
|
||||
// Returns true if log level is set to "action" or "verbose"
|
||||
EXPORT bool ActionLoggingEnabled();
|
||||
// Returns true if log level is set to "macro", "action" or "verbose"
|
||||
EXPORT bool MacroLoggingEnabled();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
Reference in New Issue
Block a user