mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-06 20:31:50 +00:00
backport per-session loglevel from stkn's branch
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16390 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -156,6 +156,7 @@ struct switch_core_session {
|
||||
uint32_t read_frame_count;
|
||||
uint32_t track_duration;
|
||||
uint32_t track_id;
|
||||
switch_log_level_t loglevel;
|
||||
};
|
||||
|
||||
struct switch_media_bug {
|
||||
|
||||
@@ -537,6 +537,7 @@ SWITCH_DECLARE(void) switch_channel_clear_app_flag(switch_channel_t *channel, ui
|
||||
SWITCH_DECLARE(int) switch_channel_test_app_flag(switch_channel_t *channel, uint32_t flags);
|
||||
SWITCH_DECLARE(void) switch_channel_set_hangup_time(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(switch_call_direction_t) switch_channel_direction(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(switch_core_session_t*) switch_channel_get_session(switch_channel_t *channel);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -676,6 +676,22 @@ SWITCH_DECLARE(void) switch_core_session_signal_state_change(_In_ switch_core_se
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_core_session_get_uuid(_In_ switch_core_session_t *session);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Sets the log level for a session
|
||||
\param session the session to set the log level on
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_set_loglevel(switch_core_session_t *session, switch_log_level_t loglevel);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Get the log level for a session
|
||||
\param session the session to get the log level from
|
||||
\return the log level
|
||||
*/
|
||||
SWITCH_DECLARE(switch_log_level_t) switch_core_session_get_loglevel(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the unique identifier from the core
|
||||
\return a string representing the uuid
|
||||
|
||||
@@ -805,7 +805,8 @@ SWITCH_CHANNEL_ID_EVENT - Write to the event engine as a LOG event
|
||||
typedef enum {
|
||||
SWITCH_CHANNEL_ID_LOG,
|
||||
SWITCH_CHANNEL_ID_LOG_CLEAN,
|
||||
SWITCH_CHANNEL_ID_EVENT
|
||||
SWITCH_CHANNEL_ID_EVENT,
|
||||
SWITCH_CHANNEL_ID_SESSION
|
||||
} switch_text_channel_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -817,11 +818,11 @@ typedef uint32_t switch_core_session_message_flag_t;
|
||||
|
||||
#define SWITCH_CHANNEL_LOG SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
|
||||
#define SWITCH_CHANNEL_LOG_CLEAN SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
|
||||
#define SWITCH_CHANNEL_SESSION_LOG_CLEAN(x) SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, ((x) ? switch_core_session_get_uuid(x) : NULL)
|
||||
#define SWITCH_CHANNEL_SESSION_LOG_CLEAN(x) SWITCH_CHANNEL_ID_LOG_CLEAN, __FILE__, __SWITCH_FUNC__, __LINE__, switch_core_session_get_uuid((x))
|
||||
#define SWITCH_CHANNEL_EVENT SWITCH_CHANNEL_ID_EVENT, __FILE__, __SWITCH_FUNC__, __LINE__, NULL
|
||||
#define SWITCH_CHANNEL_SESSION_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, ((x) ? switch_core_session_get_uuid(x) : NULL)
|
||||
#define SWITCH_CHANNEL_CHANNEL_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, ((x) ? switch_channel_get_uuid(x) : NULL)
|
||||
#define SWITCH_CHANNEL_UUID_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, x
|
||||
#define SWITCH_CHANNEL_SESSION_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)(x)
|
||||
#define SWITCH_CHANNEL_CHANNEL_LOG(x) SWITCH_CHANNEL_ID_SESSION, __FILE__, __SWITCH_FUNC__, __LINE__, (const char*)switch_channel_get_session(x)
|
||||
#define SWITCH_CHANNEL_UUID_LOG(x) SWITCH_CHANNEL_ID_LOG, __FILE__, __SWITCH_FUNC__, __LINE__, (x)
|
||||
|
||||
/*!
|
||||
\enum switch_channel_state_t
|
||||
|
||||
Reference in New Issue
Block a user