libgpac
Documentation of the core library of GPAC
|
Logging System. More...
Data Structures | |
struct | GF_LogExtra |
Extra log instructions. More... | |
Macros | |
#define | GF_LOG(_log_level, _log_tools, __args) |
Message logging. More... | |
Typedefs | |
typedef void(* | gf_log_cbk) (void *cbck, GF_LOG_Level log_level, GF_LOG_Tool log_tool, const char *fmt, va_list vlist) |
Log Message Callback. More... | |
Enumerations | |
enum | GF_LOG_Level { GF_LOG_QUIET = 0 , GF_LOG_ERROR , GF_LOG_WARNING , GF_LOG_INFO , GF_LOG_DEBUG } |
GPAC Log Levels. More... | |
enum | GF_LOG_Tool { GF_LOG_CORE = 0 , GF_LOG_CODING , GF_LOG_CONTAINER , GF_LOG_NETWORK , GF_LOG_HTTP , GF_LOG_RTP , GF_LOG_CODEC , GF_LOG_PARSER , GF_LOG_MEDIA , GF_LOG_SCENE , GF_LOG_SCRIPT , GF_LOG_INTERACT , GF_LOG_COMPOSE , GF_LOG_COMPTIME , GF_LOG_CACHE , GF_LOG_MMIO , GF_LOG_RTI , GF_LOG_MEMORY , GF_LOG_AUDIO , GF_LOG_MODULE , GF_LOG_MUTEX , GF_LOG_CONDITION , GF_LOG_DASH , GF_LOG_FILTER , GF_LOG_SCHEDULER , GF_LOG_ROUTE , GF_LOG_CONSOLE , GF_LOG_APP , GF_LOG_ALL , GF_LOG_TOOL_MAX = GF_LOG_ALL , GF_LOG_TOOL_UNDEFINED } |
GPAC Log tools. More... | |
Functions | |
Bool | gf_log_set_strict_error (Bool strict) |
Log exits at first error assignment. More... | |
char * | gf_log_get_tools_levels (void) |
gets string-formatted log tools More... | |
void | gf_log_set_tool_level (GF_LOG_Tool log_tool, GF_LOG_Level log_level) |
Log modules assignment. More... | |
gf_log_cbk | gf_log_set_callback (void *usr_cbk, gf_log_cbk cbk) |
Log overwrite. More... | |
Bool | gf_log_tool_level_on (GF_LOG_Tool log_tool, GF_LOG_Level log_level) |
Log level checking. More... | |
const char * | gf_log_tool_name (GF_LOG_Tool log_tool) |
Log tool name. More... | |
u32 | gf_log_get_tool_level (GF_LOG_Tool log_tool) |
Log level getter. More... | |
GF_Err | gf_log_set_tools_levels (const char *log_tools_levels, Bool reset_all) |
Set log tools and levels. More... | |
GF_Err | gf_log_modify_tools_levels (const char *val) |
Modify log tools and levels. More... | |
Bool | gf_log_use_color () |
Checks if color logs is enabled. More... | |
Bool | gf_log_use_file () |
Checks if logs are stored to file. More... | |
u32 | gf_log_parse_tool (const char *logs) |
Parses a log tool. More... | |
void | gf_log_reset_file () |
Resets log file Resets log file if any log file name was specified, by closing and reopening a new file. More... | |
void | gf_log_push_extra (const GF_LogExtra *log) |
void | gf_log_pop_extra (const GF_LogExtra *log) |
void | gf_log_reset_extras () |
struct GF_LogExtra |
Data Fields | ||
---|---|---|
u32 | nb_tools | number of tools and levels |
GF_LOG_Tool * | tools | additionnal tools |
GF_LOG_Level * | levels | additionnal levels for the tools |
Bool | strict | exit if error |
#define GF_LOG | ( | _log_level, | |
_log_tools, | |||
__args | |||
) |
Macro for logging messages. Usage is GF_LOG(log_lev, log_module, (fmt, ...)). The log function is only called if log filtering allows it. This avoids fetching logged parameters when the tool is not being logged.
typedef void(* gf_log_cbk) (void *cbck, GF_LOG_Level log_level, GF_LOG_Tool log_tool, const char *fmt, va_list vlist) |
The gf_log_cbk type is the type for the callback of the gf_log_set_callback function. By default all logs are redirected to stderr
cbck | Opaque user data. |
log_level | level of the log. This value is not guaranteed in multi-threaded context. |
log_tool | tool emitting the log. This value is not guaranteed in multi-threaded context. |
fmt | message log format. |
vlist | message log param. |
enum GF_LOG_Level |
These levels describes messages priority used when filtering logs
enum GF_LOG_Tool |
These flags describes which sub-part of GPAC generates the log and are used when filtering logs
When GF_LOG_ERROR happens, program leaves with instruction exit(1);
strict | strict behavior when encoutering a serious error. |
char* gf_log_get_tools_levels | ( | void | ) |
Gets the string-formatted log tools and levels. Returned string shall be freed by the caller.
void gf_log_set_tool_level | ( | GF_LOG_Tool | log_tool, |
GF_LOG_Level | log_level | ||
) |
Sets the tools to be checked for log filtering. By default no logging is performed.
log_tool | the tool to be logged |
log_level | the level of logging for this tool |
gf_log_cbk gf_log_set_callback | ( | void * | usr_cbk, |
gf_log_cbk | cbk | ||
) |
Assigns a user-defined callback for printing log messages. By default all logs are redirected to stderr
usr_cbk | Opaque user data |
cbk | Callback log function |
Bool gf_log_tool_level_on | ( | GF_LOG_Tool | log_tool, |
GF_LOG_Level | log_level | ||
) |
Checks if a given tool is logged for the given level
log_tool | tool to check |
log_level | level to check |
const char* gf_log_tool_name | ( | GF_LOG_Tool | log_tool | ) |
Gets log tool name
log_tool | tool to check |
u32 gf_log_get_tool_level | ( | GF_LOG_Tool | log_tool | ) |
Gets log level of a given tool
log_tool | tool to check |
Set log tools and levels according to the log_tools_levels string.
log_tools_levels | string specifying the tools and levels. It is formatted as logToolX@logLevelX:logToolZ@logLevelZ:... |
reset_all | if GF_TRUE, all previous log settings are discarded. |
GF_Err gf_log_modify_tools_levels | ( | const char * | val | ) |
Modify log tools and levels according to the log_tools_levels string. Previous log settings are kept.
val | string specifying the tools and levels. It is formatted as logToolX@logLevelX:logToolZ@logLevelZ:... |
Bool gf_log_use_color | ( | ) |
Checks if color logs is enabled
Bool gf_log_use_file | ( | ) |
Checks if logs are stored to file
u32 gf_log_parse_tool | ( | const char * | logs | ) |
Parses a log tool by name
logs | the name to parse |
void gf_log_reset_file | ( | ) |
void gf_log_push_extra | ( | const GF_LogExtra * | log | ) |
Register a new extra log levels
log | extra levels to add - may be NULL but shall be valid until call to gf_log_pop_extra or gf_log_reset_extras or end of app |
void gf_log_pop_extra | ( | const GF_LogExtra * | log | ) |
Unregister an extra log levels
log | extra levels to add - may be NULL |
void gf_log_reset_extras | ( | ) |
Unregister all extra log levels