linphonecore: fix linphone_core_set_log_level behavior (eg. take argument not...

linphonecore: fix linphone_core_set_log_level behavior (eg. take argument not as bit mask but minimum verbosity
parent 794ccbaa
......@@ -171,7 +171,24 @@ void linphone_core_set_log_file(FILE *file) {
}
void linphone_core_set_log_level(OrtpLogLevel loglevel) {
linphone_core_set_log_level_mask(loglevel);
OrtpLogLevel mask = loglevel;
switch (loglevel) {
case ORTP_TRACE:
case ORTP_DEBUG:
mask |= ORTP_DEBUG;
case ORTP_MESSAGE:
mask |= ORTP_MESSAGE;
case ORTP_WARNING:
mask |= ORTP_WARNING;
case ORTP_ERROR:
mask |= ORTP_ERROR;
case ORTP_FATAL:
mask |= ORTP_FATAL;
break;
case ORTP_LOGLEV_END:
break;
}
linphone_core_set_log_level_mask(mask);
}
void linphone_core_set_log_level_mask(OrtpLogLevel loglevel) {
......
......@@ -2390,12 +2390,13 @@ LINPHONE_PUBLIC void linphone_core_set_log_handler(OrtpLogFunc logfunc);
LINPHONE_PUBLIC void linphone_core_set_log_file(FILE *file);
/**
* @deprecated Use #linphone_core_set_log_level_mask instead, which is exactly the
* same function..
* @deprecated Define the log level.
*
* @param loglevel Minimum level for logging messages.
**/
LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);
/**
* Define the log level.
* Define the log level using mask.
*
* @ingroup misc
*
......
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