Skip to content

Commit

Permalink
core: kemi - more log-level message shortcut functions
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed May 29, 2018
1 parent 616b689 commit f854f2c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/core/kemi.c
Expand Up @@ -98,6 +98,36 @@ static int sr_kemi_core_info(sip_msg_t *msg, str *txt)
return 0;
}

/**
*
*/
static int sr_kemi_core_warn(sip_msg_t *msg, str *txt)
{
if(txt!=NULL && txt->s!=NULL)
LM_WARN("%.*s", txt->len, txt->s);
return 0;
}

/**
*
*/
static int sr_kemi_core_notice(sip_msg_t *msg, str *txt)
{
if(txt!=NULL && txt->s!=NULL)
LM_NOTICE("%.*s", txt->len, txt->s);
return 0;
}

/**
*
*/
static int sr_kemi_core_crit(sip_msg_t *msg, str *txt)
{
if(txt!=NULL && txt->s!=NULL)
LM_CRIT("%.*s", txt->len, txt->s);
return 0;
}

/**
*
*/
Expand Down Expand Up @@ -1157,6 +1187,21 @@ static sr_kemi_t _sr_kemi_core[] = {
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init(""), str_init("warn"),
SR_KEMIP_NONE, sr_kemi_core_warn,
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init(""), str_init("notice"),
SR_KEMIP_NONE, sr_kemi_core_notice,
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init(""), str_init("crit"),
SR_KEMIP_NONE, sr_kemi_core_crit,
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init(""), str_init("log"),
SR_KEMIP_NONE, sr_kemi_core_log,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
Expand Down

0 comments on commit f854f2c

Please sign in to comment.