diff --git a/src/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h b/src/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h index ccc5e580db2..f3337c95f54 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h +++ b/src/aws-cpp-sdk-core/include/aws/core/utils/logging/LogMacros.h @@ -58,12 +58,49 @@ } \ } - #define AWS_LOG_FATAL(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Fatal, tag, __VA_ARGS__) - #define AWS_LOG_ERROR(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Error, tag, __VA_ARGS__) - #define AWS_LOG_WARN(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Warn, tag, __VA_ARGS__) - #define AWS_LOG_INFO(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Info, tag, __VA_ARGS__) - #define AWS_LOG_DEBUG(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Debug, tag, __VA_ARGS__) - #define AWS_LOG_TRACE(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Trace, tag, __VA_ARGS__) + #define AWS_SDK_LOG_LEVEL_NONE 0 + #define AWS_SDK_LOG_LEVEL_FATAL 1 + #define AWS_SDK_LOG_LEVEL_ERROR 2 + #define AWS_SDK_LOG_LEVEL_WARN 3 + #define AWS_SDK_LOG_LEVEL_INFO 4 + #define AWS_SDK_LOG_LEVEL_DEBUG 5 + #define AWS_SDK_LOG_LEVEL_TRACE 6 + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_FATAL) + #define AWS_LOG_FATAL(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Fatal, tag, __VA_ARGS__) + #else + #define AWS_LOG_FATAL(tag, ...) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_ERROR) + #define AWS_LOG_ERROR(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Error, tag, __VA_ARGS__) + #else + #define AWS_LOG_ERROR(tag, ...) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_WARN) + #define AWS_LOG_WARN(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Warn, tag, __VA_ARGS__) + #else + #define AWS_LOG_WARN(tag, ...) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_INFO) + #define AWS_LOG_INFO(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Info, tag, __VA_ARGS__) + #else + #define AWS_LOG_INFO(tag, ...) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_DEBUG) + #define AWS_LOG_DEBUG(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Debug, tag, __VA_ARGS__) + #else + #define AWS_LOG_DEBUG(tag, ...) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_TRACE) + #define AWS_LOG_TRACE(tag, ...) AWS_LOG(Aws::Utils::Logging::LogLevel::Trace, tag, __VA_ARGS__) + #else + #define AWS_LOG_TRACE(tag, ...) + #endif #define AWS_LOGSTREAM(level, tag, streamExpression) \ { \ @@ -76,12 +113,42 @@ } \ } - #define AWS_LOGSTREAM_FATAL(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Fatal, tag, streamExpression) - #define AWS_LOGSTREAM_ERROR(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Error, tag, streamExpression) - #define AWS_LOGSTREAM_WARN(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Warn, tag, streamExpression) - #define AWS_LOGSTREAM_INFO(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Info, tag, streamExpression) - #define AWS_LOGSTREAM_DEBUG(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Debug, tag, streamExpression) - #define AWS_LOGSTREAM_TRACE(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Trace, tag, streamExpression) + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_FATAL) + #define AWS_LOGSTREAM_FATAL(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Fatal, tag, streamExpression) + #else + #define AWS_LOGSTREAM_FATAL(tag, streamExpression) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_ERROR) + #define AWS_LOGSTREAM_ERROR(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Error, tag, streamExpression) + #else + #define AWS_LOGSTREAM_ERROR(tag, streamExpression) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_WARN) + #define AWS_LOGSTREAM_WARN(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Warn, tag, streamExpression) + #else + #define AWS_LOGSTREAM_WARN(tag, streamExpression) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_INFO) + #define AWS_LOGSTREAM_INFO(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Info, tag, streamExpression) + #else + #define AWS_LOGSTREAM_INFO(tag, streamExpression) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_DEBUG) + #define AWS_LOGSTREAM_DEBUG(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Debug, tag, streamExpression) + #else + #define AWS_LOGSTREAM_DEBUG(tag, streamExpression) + #endif + + #if !defined(AWS_STATIC_LOG_LEVEL) || (AWS_STATIC_LOG_LEVEL >= AWS_SDK_LOG_LEVEL_TRACE) + #define AWS_LOGSTREAM_TRACE(tag, streamExpression) AWS_LOGSTREAM(Aws::Utils::Logging::LogLevel::Trace, tag, streamExpression) + #else + #define AWS_LOGSTREAM_TRACE(tag, streamExpression) + #endif + #define AWS_LOGSTREAM_FLUSH() AWS_LOG_FLUSH() #endif // DISABLE_AWS_LOGGING