Add trace, warn, and error markers to logged output
This commit is contained in:
parent
84f4afa5f2
commit
708f3ccc3d
@ -433,13 +433,13 @@ void *GetSymbol(void *handle, const char *name)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void al_print(const char *func, const char *fmt, ...)
|
void al_print(const char *type, const char *func, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
char str[256];
|
char str[256];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = snprintf(str, sizeof(str), "AL lib: %s: ", func);
|
i = snprintf(str, sizeof(str), "AL lib: %s %s: ", type, func);
|
||||||
if(i < (int)sizeof(str) && i > 0)
|
if(i > 0 && (unsigned int)i < sizeof(str))
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
@ -826,8 +826,8 @@ ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3],
|
|||||||
void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
|
void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
|
||||||
ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep);
|
ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep);
|
||||||
|
|
||||||
void al_print(const char *func, const char *fmt, ...) PRINTF_STYLE(2,3);
|
void al_print(const char *type, const char *func, const char *fmt, ...) PRINTF_STYLE(3,4);
|
||||||
#define AL_PRINT(...) al_print(__FUNCTION__, __VA_ARGS__)
|
#define AL_PRINT(T, ...) al_print((T), __FUNCTION__, __VA_ARGS__)
|
||||||
|
|
||||||
extern FILE *LogFile;
|
extern FILE *LogFile;
|
||||||
enum LogLevel {
|
enum LogLevel {
|
||||||
@ -841,22 +841,22 @@ extern enum LogLevel LogLevel;
|
|||||||
|
|
||||||
#define TRACEREF(...) do { \
|
#define TRACEREF(...) do { \
|
||||||
if(LogLevel >= LogRef) \
|
if(LogLevel >= LogRef) \
|
||||||
AL_PRINT(__VA_ARGS__); \
|
AL_PRINT("(--)", __VA_ARGS__); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define TRACE(...) do { \
|
#define TRACE(...) do { \
|
||||||
if(LogLevel >= LogTrace) \
|
if(LogLevel >= LogTrace) \
|
||||||
AL_PRINT(__VA_ARGS__); \
|
AL_PRINT("(II)", __VA_ARGS__); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define WARN(...) do { \
|
#define WARN(...) do { \
|
||||||
if(LogLevel >= LogWarning) \
|
if(LogLevel >= LogWarning) \
|
||||||
AL_PRINT(__VA_ARGS__); \
|
AL_PRINT("(WW)", __VA_ARGS__); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define ERR(...) do { \
|
#define ERR(...) do { \
|
||||||
if(LogLevel >= LogError) \
|
if(LogLevel >= LogError) \
|
||||||
AL_PRINT(__VA_ARGS__); \
|
AL_PRINT("(EE)", __VA_ARGS__); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user