The logging level is checked in welsCodecTrace anyway. Previously, error logging wasn't ever shown if the trace level was set to WELS_LOG_ERROR (as it was by default), since welsStderrLevelTrace required the message level to be strictly lower than the trace level.
Showing the changes to codec/common/src (2 of 3 files). Show all
Unified · Split
| @@ -35,15 +35,7 @@ · 34 unmodified lines | |||
| 35 | #include <stdio.h> | 35 | #include <stdio.h> |
| 36 | #include "typedefs.h" | 36 | #include "typedefs.h" |
| 37 | 37 | ||
| 38 | static int32_t g_TraceLevel = 0; | ||
| 39 | |||
| 40 | void WelsStderrSetTraceLevel (int32_t level) { | ||
| 41 | g_TraceLevel = level; | ||
| 42 | } | ||
| 43 | |||
| 44 | int32_t welsStderrLevelTrace (int32_t level, const char* format, va_list ap) { | 38 | int32_t welsStderrLevelTrace (int32_t level, const char* format, va_list ap) { |
| 45 | if (level < g_TraceLevel) { | 39 | vfprintf (stderr, format, ap); |
| 46 | vfprintf (stderr, format, ap); | ||
| 47 | } | ||
| 48 | return 0; | 40 | return 0; |
| 49 | } | 41 | } |
| @@ -108,7 +108,6 @@ void welsCodecTrace::CODEC_TRACE (void* ignore, const int32_t iLevel, const char · 107 unmodified lines | |||
| 108 | void welsCodecTrace::SetTraceLevel (const int32_t iLevel) { | 108 | void welsCodecTrace::SetTraceLevel (const int32_t iLevel) { |
| 109 | if (iLevel >= 0) | 109 | if (iLevel >= 0) |
| 110 | m_iTraceLevel = iLevel; | 110 | m_iTraceLevel = iLevel; |
| 111 | WelsStderrSetTraceLevel (iLevel); | ||
| 112 | } | 111 | } |
| 113 | 112 | ||
| 114 | 113 | ||