Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Logger Routines
[Core Library]


Data Structures

struct  switch_log_node_t
 Log Data. More...

Defines

#define switch_log_check_mask(_mask, _level)   (_mask & (1 << _level))

Typedefs

typedef switch_status_t(* switch_log_function_t )(const switch_log_node_t *node, switch_log_level_t level)

Functions

switch_status_t switch_log_init (_In_ switch_memory_pool_t *pool, _In_ switch_bool_t colorize)
 Initilize the logging engine.
switch_status_t switch_log_shutdown (void)
 Shut down the logging engine.
void switch_log_printf (_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
 Write log data to the logging engine.
switch_status_t switch_log_bind_logger (_In_ switch_log_function_t function, _In_ switch_log_level_t level, _In_ switch_bool_t is_console)
 Shut down the logging engine.
switch_status_t switch_log_unbind_logger (_In_ switch_log_function_t function)
_Ret_z_ const char * switch_log_level2str (_In_ switch_log_level_t level)
 Return the name of the specified log level.
switch_log_level_t switch_log_str2level (_In_z_ const char *str)
 Return the level number of the specified log level name.
uint32_t switch_log_str2mask (_In_z_ const char *str)


Define Documentation

#define switch_log_check_mask _mask,
_level   )     (_mask & (1 << _level))
 


Typedef Documentation

typedef switch_status_t(* switch_log_function_t)(const switch_log_node_t *node, switch_log_level_t level)
 


Function Documentation

switch_status_t switch_log_bind_logger _In_ switch_log_function_t  function,
_In_ switch_log_level_t  level,
_In_ switch_bool_t  is_console
 

Shut down the logging engine.

Note:
to be called at application termination by the core

switch_status_t switch_log_init _In_ switch_memory_pool_t pool,
_In_ switch_bool_t  colorize
 

Initilize the logging engine.

Parameters:
pool the memory pool to use
Note:
to be called at application startup by the core

_Ret_z_ const char* switch_log_level2str _In_ switch_log_level_t  level  ) 
 

Return the name of the specified log level.

Parameters:
level the level
Returns:
the name of the log level

void switch_log_printf _In_ switch_text_channel_t  channel,
_In_z_ const char *  file,
_In_z_ const char *  func,
_In_ int  line,
_In_opt_z_ const char *  userdata,
_In_ switch_log_level_t  level,
_In_z_ _Printf_format_string_ const char *  fmt,
  ...
 

Write log data to the logging engine.

Parameters:
channel the log channel to write to
file the current file
func the current function
line the current line
userdata ununsed
level the current log level
fmt desired format
... variable args
Note:
there are channel macros to supply the first 4 parameters

switch_status_t switch_log_shutdown void   ) 
 

Shut down the logging engine.

Note:
to be called at application termination by the core
00435 {
00436 
00437         THREAD_RUNNING = -1;
00438         switch_queue_push(LOG_QUEUE, NULL);
00439         while (THREAD_RUNNING) {
00440                 switch_yield(1000);
00441         }
00442         switch_core_memory_reclaim_logger();
00443 
00444         return SWITCH_STATUS_SUCCESS;
00445 }

Here is the call graph for this function:

switch_log_level_t switch_log_str2level _In_z_ const char *  str  ) 
 

Return the level number of the specified log level name.

Parameters:
str the name of the level
Returns:
the log level

uint32_t switch_log_str2mask _In_z_ const char *  str  ) 
 

switch_status_t switch_log_unbind_logger _In_ switch_log_function_t  function  ) 
 


Generated on Fri Oct 10 11:25:13 2008 for FreeSWITCH by  doxygen 1.3.9.1