From 3fd1d3c8ebdde75bf00a36968681222f8dd9a2f3 Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Tue, 3 May 2022 13:38:11 -0700 Subject: [PATCH] Enable GPGMM_ENABLE_ASSERT_ON_WARNING for non-event logs. --- src/gpgmm/common/Debug.cpp | 3 --- src/gpgmm/common/EventTraceWriter.cpp | 2 +- src/gpgmm/utils/Log.cpp | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gpgmm/common/Debug.cpp b/src/gpgmm/common/Debug.cpp index be89a1818..3de1594f0 100644 --- a/src/gpgmm/common/Debug.cpp +++ b/src/gpgmm/common/Debug.cpp @@ -33,9 +33,6 @@ namespace gpgmm { const std::string description = mStream.str(); gpgmm::Log(mSeverity) << mName << ": " << description; -#if defined(GPGMM_ENABLE_ASSERT_ON_WARNING) - ASSERT(mSeverity < LogSeverity::Warning); -#endif if (mSeverity >= gRecordEventLevel) { LOG_MESSAGE message{description, mMessageId}; GPGMM_TRACE_EVENT_OBJECT_CALL(mName, message); diff --git a/src/gpgmm/common/EventTraceWriter.cpp b/src/gpgmm/common/EventTraceWriter.cpp index 3662a44ae..6d8c773b5 100644 --- a/src/gpgmm/common/EventTraceWriter.cpp +++ b/src/gpgmm/common/EventTraceWriter.cpp @@ -158,7 +158,7 @@ namespace gpgmm { std::ofstream outFile; outFile.open(mTraceFile); if (!outFile.fail()) { - WarningLog() << mTraceFile + " exists and will be overwritten."; + InfoLog() << mTraceFile + " exists and will be overwritten."; } outFile << traceData.ToString(); diff --git a/src/gpgmm/utils/Log.cpp b/src/gpgmm/utils/Log.cpp index 5fd8e98ee..cc5fee96e 100644 --- a/src/gpgmm/utils/Log.cpp +++ b/src/gpgmm/utils/Log.cpp @@ -136,6 +136,10 @@ namespace gpgmm { ToString(std::this_thread::get_id()).c_str(), fullMessage.c_str()); fflush(outputStream); #endif + +#if defined(GPGMM_ENABLE_ASSERT_ON_WARNING) + ASSERT(mSeverity < LogSeverity::Warning); +#endif } LogMessage DebugLog() {