mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
file/func specific logging
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1128 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -41,7 +41,8 @@ static const char *LEVELS[] = {
|
||||
"NOTICE" ,
|
||||
"INFO" ,
|
||||
"DEBUG" ,
|
||||
"CONSOLE"
|
||||
"CONSOLE",
|
||||
NULL
|
||||
};
|
||||
|
||||
struct switch_log_binding {
|
||||
@@ -59,6 +60,28 @@ static switch_queue_t *LOG_QUEUE = NULL;
|
||||
static int8_t THREAD_RUNNING = 0;
|
||||
static uint8_t MAX_LEVEL = 0;
|
||||
|
||||
SWITCH_DECLARE(const char *) switch_log_level2str(switch_log_level level)
|
||||
{
|
||||
return LEVELS[level];
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_log_level) switch_log_str2level(const char *str)
|
||||
{
|
||||
int x = 0;
|
||||
switch_log_level level = SWITCH_LOG_DEBUG;
|
||||
for(x = 0;;x++) {
|
||||
if (!LEVELS[x]) {
|
||||
break;
|
||||
}
|
||||
if (!strcasecmp(LEVELS[x], str)) {
|
||||
level = (switch_log_level) x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status) switch_log_bind_logger(switch_log_function function, switch_log_level level)
|
||||
{
|
||||
switch_log_binding *binding = NULL, *ptr = NULL;
|
||||
|
Reference in New Issue
Block a user