Commit 9f51aa25 authored by Ghislain MARY's avatar Ghislain MARY

Add the ortp_get_log_level_mask() function.

parent 35f5efbf
......@@ -51,9 +51,7 @@ ORTP_PUBLIC void ortp_set_log_handler(OrtpLogFunc func);
ORTP_VAR_PUBLIC OrtpLogFunc ortp_logv_out;
ORTP_PUBLIC extern unsigned int __ortp_log_mask;
#define ortp_log_level_enabled(level) (__ortp_log_mask & (level))
#define ortp_log_level_enabled(level) (ortp_get_log_level_mask() & (level))
#if !defined(WIN32) && !defined(_WIN32_WCE)
#define ortp_logv(level,fmt,args) \
......@@ -67,6 +65,7 @@ ORTP_PUBLIC void ortp_logv(int level, const char *fmt, va_list args);
#endif
ORTP_PUBLIC void ortp_set_log_level_mask(int levelmask);
ORTP_PUBLIC int ortp_get_log_level_mask(void);
#ifdef __GNUC__
#define CHECK_FORMAT_ARGS(m,n) __attribute__((format(printf,m,n)))
......
......@@ -45,7 +45,7 @@ void ortp_set_log_handler(OrtpLogFunc func){
}
unsigned int __ortp_log_mask=ORTP_WARNING|ORTP_ERROR|ORTP_FATAL;
static unsigned int __ortp_log_mask=ORTP_WARNING|ORTP_ERROR|ORTP_FATAL;
/**
* @ param levelmask a mask of ORTP_DEBUG, ORTP_MESSAGE, ORTP_WARNING, ORTP_ERROR
......@@ -55,6 +55,10 @@ void ortp_set_log_level_mask(int levelmask){
__ortp_log_mask=levelmask;
}
int ortp_get_log_level_mask(void) {
return __ortp_log_mask;
}
char * ortp_strdup_vprintf(const char *fmt, va_list ap)
{
/* Guess we need no more than 100 bytes. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment