Skip to content

Commit

Permalink
dialog: replaced inline function with a single log with a macro
Browse files Browse the repository at this point in the history
- makes possible to get the file name and line of its usage
  • Loading branch information
miconda committed Dec 28, 2017
1 parent 4d4c91a commit eb01667
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/modules/dialog/dlg_hash.c
Expand Up @@ -956,18 +956,19 @@ void dlg_release(dlg_cell_t *dlg)


/*!
* \brief Small logging helper functions for next_state_dlg.
* \brief Small logging helper macro for next_state_dlg.
* \param event logged event
* \param dlg dialog data
* \see next_state_dlg
*/
static inline void log_next_state_dlg(const int event, const struct dlg_cell *dlg) {
LM_CRIT("bogus event %d in state %d for dlg %p [%u:%u] with clid '%.*s' and tags "
"'%.*s' '%.*s'\n", event, dlg->state, dlg, dlg->h_entry, dlg->h_id,
dlg->callid.len, dlg->callid.s,
dlg->tag[DLG_CALLER_LEG].len, dlg->tag[DLG_CALLER_LEG].s,
dlg->tag[DLG_CALLEE_LEG].len, dlg->tag[DLG_CALLEE_LEG].s);
}
#define log_next_state_dlg(event, dlg) do { \
LM_CRIT("bogus event %d in state %d for dlg %p [%u:%u]" \
" with clid '%.*s' and tags" \
" '%.*s' '%.*s'\n", event, (dlg)->state, (dlg), \
(dlg)->h_entry, (dlg)->h_id, (dlg)->callid.len, (dlg)->callid.s, \
(dlg)->tag[DLG_CALLER_LEG].len, (dlg)->tag[DLG_CALLER_LEG].s, \
(dlg)->tag[DLG_CALLEE_LEG].len, (dlg)->tag[DLG_CALLEE_LEG].s); \
} while(0)


/*!
Expand Down

0 comments on commit eb01667

Please sign in to comment.