TT#119502 quiet logging for foreign calls

Change-Id: I5ae02e47b839f23ccc3d2a7ca48d43ada6ae3d41
pull/1285/head
Richard Fuchs 5 years ago
parent 89666c8021
commit aabcfaff17

@ -137,20 +137,26 @@ void rtcplog(const char* cdrbuffer) {
}
int get_local_log_level(unsigned int subsystem_idx) {
struct call *call = NULL;
switch (log_info.e) {
case LOG_INFO_CALL:
if (log_info.u.call->debug)
return 8;
return -1;
call = log_info.u.call;
break;
case LOG_INFO_STREAM_FD:
if (log_info.u.stream_fd->call && log_info.u.stream_fd->call->debug)
return 8;
return -1;
call = log_info.u.stream_fd->call;
break;
case LOG_INFO_ICE_AGENT:
if (log_info.u.ice_agent->call && log_info.u.ice_agent->call->debug)
return 8;
return -1;
call = log_info.u.ice_agent->call;
break;
default:
return -1;
break;
}
if (!call)
return -1;
if (call->foreign_call)
return 5 | LOG_FLAG_MAX;
if (call->debug)
return 8;
return -1;
}

@ -64,14 +64,33 @@ extern const char * const log_level_descriptions[];
#define ilogs(system, prio, fmt, ...) ilogsn(log_level_index_ ## system, prio, fmt, ##__VA_ARGS__)
#define LOG_LEVEL_MASK(v) ((v) & 0x0f)
#define LOG_FLAG_RESTORE 0x10
#define LOG_FLAG_LIMIT 0x20
#define LOG_FLAG_MAX 0x40
#define LOG_FLAG_MIN 0x80
INLINE int __get_log_level(unsigned int idx) {
if (!rtpe_common_config_ptr)
return 8;
if (idx >= MAX_LOG_LEVELS)
return 8;
int local_log_level = get_local_log_level(idx);
if (local_log_level >= 0)
if (local_log_level >= 0) {
if ((local_log_level & LOG_FLAG_MAX)) {
int level = g_atomic_int_get(&rtpe_common_config_ptr->log_levels[idx]);
local_log_level = LOG_LEVEL_MASK(local_log_level);
return MIN(level, local_log_level);
}
if ((local_log_level & LOG_FLAG_MIN)) {
int level = g_atomic_int_get(&rtpe_common_config_ptr->log_levels[idx]);
local_log_level = LOG_LEVEL_MASK(local_log_level);
return MAX(level, local_log_level);
}
return local_log_level;
}
return g_atomic_int_get(&rtpe_common_config_ptr->log_levels[idx]);
}
#define get_log_level(system) __get_log_level(log_level_index_ ## system)
@ -87,10 +106,4 @@ INLINE int __get_log_level(unsigned int idx) {
#define LOG_WARN LOG_WARNING
#define LOG_LEVEL_MASK(v) ((v) & 0x0f)
#define LOG_FLAG_RESTORE 0x10
#define LOG_FLAG_LIMIT 0x20
#endif

Loading…
Cancel
Save