|
|
@@ -30,13 +30,7 @@ namespace AZ
|
|
|
void OutputToDebugger(AZStd::basic_string_view<char, AZStd::char_traits<char>> window, AZStd::basic_string_view<char, AZStd::char_traits<char>> message);
|
|
|
}
|
|
|
|
|
|
- enum LogLevel : int
|
|
|
- {
|
|
|
- Disabled = 0,
|
|
|
- Errors = 1,
|
|
|
- Warnings = 2,
|
|
|
- Info = 3
|
|
|
- };
|
|
|
+ enum class LogLevel { Disabled = 0, Errors = 1, Warnings = 2, Info = 3, Debug = 4, Trace = 5 };
|
|
|
|
|
|
// Represents the options to select C language FILE* stream to write raw output
|
|
|
enum class RedirectCStream
|
|
|
@@ -286,10 +280,10 @@ namespace AZ
|
|
|
"String used in place of boolean expression for AZ_ErrorOnce.", \
|
|
|
"Did you mean AZ_ErrorOnce("#window", false, \"%s\", "#expression"); ?", \
|
|
|
"Did you mean AZ_ErrorOnce("#window", false, "#expression", "#__VA_ARGS__"); ?"); \
|
|
|
- static bool AZ_CONCAT_VAR_NAME(azErrorDisplayed, __LINE__) = false; \
|
|
|
- if (!AZ_CONCAT_VAR_NAME(azErrorDisplayed, __LINE__)) \
|
|
|
+ static bool AZ_CONCAT_VAR_NAME(azErrorDisplayed, __LINE__) = false; \
|
|
|
+ if (!AZ_CONCAT_VAR_NAME(azErrorDisplayed, __LINE__)) \
|
|
|
{ \
|
|
|
- AZ_CONCAT_VAR_NAME(azErrorDisplayed, __LINE__) = true; \
|
|
|
+ AZ_CONCAT_VAR_NAME(azErrorDisplayed, __LINE__) = true; \
|
|
|
AZ::Debug::Trace::Instance().Error(__FILE__, __LINE__, AZ_FUNCTION_SIGNATURE, window, __VA_ARGS__); \
|
|
|
} \
|
|
|
} \
|
|
|
@@ -319,22 +313,50 @@ namespace AZ
|
|
|
"String used in place of boolean expression for AZ_WarningOnce.", \
|
|
|
"Did you mean AZ_WarningOnce("#window", false, \"%s\", "#expression"); ?", \
|
|
|
"Did you mean AZ_WarningOnce("#window", false, "#expression", "#__VA_ARGS__"); ?"); \
|
|
|
- static bool AZ_CONCAT_VAR_NAME(azWarningDisplayed, __LINE__) = false; \
|
|
|
- if (!AZ_CONCAT_VAR_NAME(azWarningDisplayed, __LINE__)) \
|
|
|
+ static bool AZ_CONCAT_VAR_NAME(azWarningDisplayed, __LINE__) = false; \
|
|
|
+ if (!AZ_CONCAT_VAR_NAME(azWarningDisplayed, __LINE__)) \
|
|
|
{ \
|
|
|
AZ::Debug::Trace::Instance().Warning(__FILE__, __LINE__, AZ_FUNCTION_SIGNATURE, window, __VA_ARGS__); \
|
|
|
- AZ_CONCAT_VAR_NAME(azWarningDisplayed, __LINE__) = true; \
|
|
|
+ AZ_CONCAT_VAR_NAME(azWarningDisplayed, __LINE__) = true; \
|
|
|
} \
|
|
|
} \
|
|
|
AZ_POP_DISABLE_WARNING
|
|
|
|
|
|
- #define AZ_TracePrintf(window, ...) \
|
|
|
- if(AZ::Debug::Trace::Instance().IsTraceLoggingEnabledForLevel(AZ::Debug::LogLevel::Info)) \
|
|
|
+ #define AZ_Info(window, ...) \
|
|
|
+ if(AZ::Debug::Trace::Instance().IsTraceLoggingEnabledForLevel(AZ::Debug::LogLevel::Info)) \
|
|
|
{ \
|
|
|
AZ::Debug::Trace::Instance().Printf(window, __VA_ARGS__); \
|
|
|
}
|
|
|
|
|
|
+ #define AZ_Trace(window, ...) \
|
|
|
+ if(AZ::Debug::Trace::Instance().IsTraceLoggingEnabledForLevel(AZ::Debug::LogLevel::Trace)) \
|
|
|
+ { \
|
|
|
+ AZ::Debug::Trace::Instance().Printf(window, __VA_ARGS__); \
|
|
|
+ }
|
|
|
+
|
|
|
+ //! The AZ_TraceOnce macro output the result of the format string only once for each use of the macro
|
|
|
+ //! It does not take into account the result of the format string to determine whether to output the string or not
|
|
|
+ //! What this means is that if the formatting results in different output string result only the first result
|
|
|
+ //! will ever be output
|
|
|
+ #define AZ_TraceOnce(window, ...) \
|
|
|
+ { \
|
|
|
+ static bool AZ_CONCAT_VAR_NAME(azTracePrintfDisplayed, __LINE__) = false; \
|
|
|
+ if (!AZ_CONCAT_VAR_NAME(azTracePrintfDisplayed, __LINE__)) \
|
|
|
+ { \
|
|
|
+ AZ_Trace(window, __VA_ARGS__); \
|
|
|
+ AZ_CONCAT_VAR_NAME(azTracePrintfDisplayed, __LINE__) = true; \
|
|
|
+ } \
|
|
|
+ }
|
|
|
+
|
|
|
+ // O3DE_DEPRECATION_NOTICE(GHI-xxxx) - Use AZ_Trace
|
|
|
+ // Use of AZ_TracePrintf and AZ_TracePrintfOnce are deprecated
|
|
|
+ #define AZ_TracePrintf(window, ...) \
|
|
|
+ if(AZ::Debug::Trace::Instance().IsTraceLoggingEnabledForLevel(AZ::Debug::LogLevel::Info)) \
|
|
|
+ { \
|
|
|
+ AZ::Debug::Trace::Instance().Printf(window, __VA_ARGS__); \
|
|
|
+ }
|
|
|
|
|
|
+ // O3DE_DEPRECATION_NOTICE(GHI-xxxx) - Use AZ_TraceOnce
|
|
|
//! The AZ_TrancePrintfOnce macro output the result of the format string only once for each use of the macro
|
|
|
//! It does not take into account the result of the format string to determine whether to output the string or not
|
|
|
//! What this means is that if the formatting results in different output string result only the first result
|