log.h File Reference

This file implements log facility of the library. More...

#include "platform.h"
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AST_MAX_LOG_MESSAGE_SIZE   512
 Max Log Message Length. More...
 

Typedefs

typedef void(* ast_log_handler_func_t) (ast_log_level_t level, const char *message)
 Function prototype of log handler callback. More...
 

Enumerations

enum  ast_log_level_t {
  AST_LOG_DEBUG = 0, AST_LOG_INFO, AST_LOG_WARNING, AST_LOG_CRITICAL,
  AST_LOG_PANIC
}
 Log Level. More...
 

Functions

void ast_log_handler_reg (const ast_log_handler_func_t func)
 Register log handler callback function. More...
 
void ast_log_stdout (ast_log_level_t level, const char *message)
 Log handler that will print message to stdout. More...
 

Detailed Description

This file implements log facility of the library.

Macro Definition Documentation

◆ AST_MAX_LOG_MESSAGE_SIZE

#define AST_MAX_LOG_MESSAGE_SIZE   512

Max Log Message Length.

Typedef Documentation

◆ ast_log_handler_func_t

typedef void(* ast_log_handler_func_t) (ast_log_level_t level, const char *message)

Function prototype of log handler callback.

Enumeration Type Documentation

◆ ast_log_level_t

Log Level.

Enumerator
AST_LOG_DEBUG 

Messages that will only be shown in debug build.

AST_LOG_INFO 

General information message.

AST_LOG_WARNING 

Non important errors.

AST_LOG_CRITICAL 

Error that will cause cause decoding/encoding fail.

AST_LOG_PANIC 

Error that will cause library crash.

Function Documentation

◆ ast_log_handler_reg()

void ast_log_handler_reg ( const ast_log_handler_func_t  func)

Register log handler callback function.

◆ ast_log_stdout()

void ast_log_stdout ( ast_log_level_t  level,
const char *  message 
)

Log handler that will print message to stdout.