Remove WelsStderrSetTraceLevel

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.
This commit is contained in:
Martin Storsjö
2014-06-10 11:40:38 +03:00
parent 90be3d8215
commit cfc9367610
3 changed files with 1 additions and 13 deletions

View File

@@ -35,9 +35,6 @@
#ifndef WELS_LOGGING_H__ #ifndef WELS_LOGGING_H__
#define WELS_LOGGING_H__ #define WELS_LOGGING_H__
// API surface.
void WelsStderrSetTraceLevel (int32_t level);
// Internal details. // Internal details.
int32_t welsStderrLevelTrace (int32_t level, const char* format, va_list ap); int32_t welsStderrLevelTrace (int32_t level, const char* format, va_list ap);

View File

@@ -35,15 +35,7 @@
#include <stdio.h> #include <stdio.h>
#include "typedefs.h" #include "typedefs.h"
static int32_t g_TraceLevel = 0;
void WelsStderrSetTraceLevel (int32_t level) {
g_TraceLevel = level;
}
int32_t welsStderrLevelTrace (int32_t level, const char* format, va_list ap) { int32_t welsStderrLevelTrace (int32_t level, const char* format, va_list ap) {
if (level < g_TraceLevel) {
vfprintf (stderr, format, ap); vfprintf (stderr, format, ap);
}
return 0; return 0;
} }

View File

@@ -108,7 +108,6 @@ void welsCodecTrace::CODEC_TRACE (void* ignore, const int32_t iLevel, const char
void welsCodecTrace::SetTraceLevel (const int32_t iLevel) { void welsCodecTrace::SetTraceLevel (const int32_t iLevel) {
if (iLevel >= 0) if (iLevel >= 0)
m_iTraceLevel = iLevel; m_iTraceLevel = iLevel;
WelsStderrSetTraceLevel (iLevel);
} }