Merge pull request #205 from mstorsjo/cleanup-trace
Remove the unused dllname parameter to the trace function
This commit is contained in:
commit
58c33b8ee8
@ -43,13 +43,7 @@ void WelsStderrSetTraceLevel (int32_t level);
|
|||||||
int32_t welsStderrLevelTrace (int32_t level, const str_t* format, va_list ap);
|
int32_t welsStderrLevelTrace (int32_t level, const str_t* format, va_list ap);
|
||||||
|
|
||||||
template<int level> int32_t welsStderrTrace (
|
template<int level> int32_t welsStderrTrace (
|
||||||
#ifndef WIN32
|
|
||||||
const str_t* dllname,
|
|
||||||
#endif
|
|
||||||
const str_t* format, ...) {
|
const str_t* format, ...) {
|
||||||
#ifndef WIN32
|
|
||||||
(void)dllname; // Unused.
|
|
||||||
#endif
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start (ap, format);
|
va_start (ap, format);
|
||||||
welsStderrLevelTrace (level, format, ap);
|
welsStderrLevelTrace (level, format, ap);
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
//using namespace WelsDec;
|
//using namespace WelsDec;
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
typedef int (*CM_WELS_TRACE) (const char* kpFormat, ...);
|
typedef int (*CM_WELS_TRACE) (const char* kpFormat, ...);
|
||||||
#else
|
|
||||||
typedef int (*CM_WELS_TRACE) (const char* kpDllName, const char* kpFormat, ...);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -322,7 +322,6 @@ int32_t CWelsCodecTrace::WriteString (int32_t iLevel, const str_t* pStr) {
|
|||||||
if (m_hTraceHandle)
|
if (m_hTraceHandle)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
switch (iLevel) {
|
switch (iLevel) {
|
||||||
case WELS_LOG_ERROR:
|
case WELS_LOG_ERROR:
|
||||||
if (m_fpErrorTrace)
|
if (m_fpErrorTrace)
|
||||||
@ -345,30 +344,6 @@ int32_t CWelsCodecTrace::WriteString (int32_t iLevel, const str_t* pStr) {
|
|||||||
m_fpDebugTrace ("%s", pStr);
|
m_fpDebugTrace ("%s", pStr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
switch (iLevel) {
|
|
||||||
case WELS_LOG_ERROR:
|
|
||||||
if (m_fpErrorTrace)
|
|
||||||
m_fpErrorTrace ("CODEC", "%s", pStr);
|
|
||||||
break;
|
|
||||||
case WELS_LOG_WARNING:
|
|
||||||
if (m_fpWarnTrace)
|
|
||||||
m_fpWarnTrace ("CODEC", "%s", pStr);
|
|
||||||
break;
|
|
||||||
case WELS_LOG_INFO:
|
|
||||||
if (m_fpInfoTrace)
|
|
||||||
m_fpInfoTrace ("CODEC", "%s", pStr);
|
|
||||||
break;
|
|
||||||
case WELS_LOG_DEBUG:
|
|
||||||
if (m_fpInfoTrace)
|
|
||||||
m_fpInfoTrace ("CODEC", "%s", pStr);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (m_fpInfoTrace)
|
|
||||||
m_fpInfoTrace ("CODEC", "%s", pStr);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -36,11 +36,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
typedef int32_t (*CM_WELS_TRACE) (const str_t* format, ...);
|
typedef int32_t (*CM_WELS_TRACE) (const str_t* format, ...);
|
||||||
#else
|
|
||||||
typedef int32_t (*CM_WELS_TRACE2) (const str_t* dllname, const str_t* format, ...);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class welsCodecTrace {
|
class welsCodecTrace {
|
||||||
public:
|
public:
|
||||||
@ -60,17 +56,10 @@ class welsCodecTrace {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static int32_t m_iTraceLevel;
|
static int32_t m_iTraceLevel;
|
||||||
#if defined _WIN32
|
|
||||||
static CM_WELS_TRACE m_fpDebugTrace;
|
static CM_WELS_TRACE m_fpDebugTrace;
|
||||||
static CM_WELS_TRACE m_fpInfoTrace;
|
static CM_WELS_TRACE m_fpInfoTrace;
|
||||||
static CM_WELS_TRACE m_fpWarnTrace;
|
static CM_WELS_TRACE m_fpWarnTrace;
|
||||||
static CM_WELS_TRACE m_fpErrorTrace;
|
static CM_WELS_TRACE m_fpErrorTrace;
|
||||||
#else
|
|
||||||
static CM_WELS_TRACE2 m_fpDebugTrace;
|
|
||||||
static CM_WELS_TRACE2 m_fpInfoTrace;
|
|
||||||
static CM_WELS_TRACE2 m_fpWarnTrace;
|
|
||||||
static CM_WELS_TRACE2 m_fpErrorTrace;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -137,17 +137,10 @@ static void* GetProcessAddress (CFBundleRef bundle, const str_t* lpszprocname) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32_t welsCodecTrace::m_iTraceLevel = WELS_LOG_DEFAULT;
|
int32_t welsCodecTrace::m_iTraceLevel = WELS_LOG_DEFAULT;
|
||||||
#if defined(_WIN32)
|
|
||||||
CM_WELS_TRACE welsCodecTrace::m_fpDebugTrace = NULL;
|
CM_WELS_TRACE welsCodecTrace::m_fpDebugTrace = NULL;
|
||||||
CM_WELS_TRACE welsCodecTrace::m_fpInfoTrace = NULL;
|
CM_WELS_TRACE welsCodecTrace::m_fpInfoTrace = NULL;
|
||||||
CM_WELS_TRACE welsCodecTrace::m_fpWarnTrace = NULL;
|
CM_WELS_TRACE welsCodecTrace::m_fpWarnTrace = NULL;
|
||||||
CM_WELS_TRACE welsCodecTrace::m_fpErrorTrace = NULL;
|
CM_WELS_TRACE welsCodecTrace::m_fpErrorTrace = NULL;
|
||||||
#else
|
|
||||||
CM_WELS_TRACE2 welsCodecTrace::m_fpDebugTrace = NULL;
|
|
||||||
CM_WELS_TRACE2 welsCodecTrace::m_fpInfoTrace = NULL;
|
|
||||||
CM_WELS_TRACE2 welsCodecTrace::m_fpWarnTrace = NULL;
|
|
||||||
CM_WELS_TRACE2 welsCodecTrace::m_fpErrorTrace = NULL;
|
|
||||||
#endif//WIN32
|
|
||||||
|
|
||||||
welsCodecTrace::welsCodecTrace() {
|
welsCodecTrace::welsCodecTrace() {
|
||||||
m_hTraceHandle = NULL;
|
m_hTraceHandle = NULL;
|
||||||
@ -272,7 +265,6 @@ int32_t welsCodecTrace::WelsTraceModuleIsExist() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void welsCodecTrace::TraceString (int32_t iLevel, const str_t* str) {
|
void welsCodecTrace::TraceString (int32_t iLevel, const str_t* str) {
|
||||||
#ifdef _WIN32
|
|
||||||
switch (iLevel) {
|
switch (iLevel) {
|
||||||
case WELS_LOG_ERROR:
|
case WELS_LOG_ERROR:
|
||||||
if (m_fpErrorTrace)
|
if (m_fpErrorTrace)
|
||||||
@ -295,30 +287,6 @@ void welsCodecTrace::TraceString (int32_t iLevel, const str_t* str) {
|
|||||||
m_fpInfoTrace ("%s", str);
|
m_fpInfoTrace ("%s", str);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
switch (iLevel) {
|
|
||||||
case WELS_LOG_ERROR:
|
|
||||||
if (m_fpErrorTrace)
|
|
||||||
m_fpErrorTrace ("CODEC", "%s", str);
|
|
||||||
break;
|
|
||||||
case WELS_LOG_WARNING:
|
|
||||||
if (m_fpWarnTrace)
|
|
||||||
m_fpWarnTrace ("CODEC", "%s", str);
|
|
||||||
break;
|
|
||||||
case WELS_LOG_INFO:
|
|
||||||
if (m_fpInfoTrace)
|
|
||||||
m_fpInfoTrace ("CODEC", "%s", str);
|
|
||||||
break;
|
|
||||||
case WELS_LOG_DEBUG:
|
|
||||||
if (m_fpInfoTrace)
|
|
||||||
m_fpInfoTrace ("CODEC", "%s", str);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (m_fpInfoTrace)
|
|
||||||
m_fpInfoTrace ("CODEC", "%s", str);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_LOG_SIZE 1024
|
#define MAX_LOG_SIZE 1024
|
||||||
|
Loading…
x
Reference in New Issue
Block a user