mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-02 03:24:54 +00:00
dox and add a func to logger
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1124 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
1bb893efae
commit
53706b9fe2
@ -56,6 +56,9 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _FORMATBUG
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
|
@ -47,25 +47,32 @@ extern "C" {
|
|||||||
|
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
|
///\defgroup log Logger Routines
|
||||||
|
///\ingroup core1
|
||||||
|
///\{
|
||||||
|
|
||||||
|
|
||||||
|
/*! \brief Log Data
|
||||||
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
/*! The complete log message */
|
||||||
char *data;
|
char *data;
|
||||||
|
/*! The file where the message originated */
|
||||||
char *file;
|
char *file;
|
||||||
char *func;
|
/*! The line number where the message originated */
|
||||||
char *content;
|
|
||||||
uint32_t line;
|
uint32_t line;
|
||||||
|
/*! The function where the message originated */
|
||||||
|
char *func;
|
||||||
|
/*! The log level of the message */
|
||||||
switch_log_level level;
|
switch_log_level level;
|
||||||
|
/*! The time when the log line was sent */
|
||||||
switch_time_t timestamp;
|
switch_time_t timestamp;
|
||||||
|
/*! A pointer to where the actual content of the message starts (skipping past the preformatted portion) */
|
||||||
|
char *content;
|
||||||
} switch_log_node;
|
} switch_log_node;
|
||||||
|
|
||||||
typedef switch_status (*switch_log_function)(const switch_log_node *node, switch_log_level level);
|
typedef switch_status (*switch_log_function)(const switch_log_node *node, switch_log_level level);
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief A method akin to printf that allows you to redirect output to a specific log
|
|
||||||
*/
|
|
||||||
|
|
||||||
///\defgroup log Logger Routines
|
|
||||||
///\ingroup core1
|
|
||||||
///\{
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Initilize the logging engine
|
\brief Initilize the logging engine
|
||||||
@ -100,6 +107,13 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file,
|
|||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status) switch_log_bind_logger(switch_log_function function, switch_log_level level);
|
SWITCH_DECLARE(switch_status) switch_log_bind_logger(switch_log_function function, switch_log_level level);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Return the name of the specified log level
|
||||||
|
\param level the level
|
||||||
|
\return the name of the log level
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(const char *) switch_log_level2str(switch_log_level level);
|
||||||
|
|
||||||
///\}
|
///\}
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user