Haka
|
Go to the source code of this file.
Data Structures | |
struct | logger |
Macros | |
#define | INVALID_SECTION_ID -1 |
#define | LOG_FATAL(section, fmt, ...) LOG(HAKA_LOG_FATAL, section, fmt, ##__VA_ARGS__) |
Typedefs | |
typedef int | section_id |
Enumerations |
Functions | |
const char * | level_to_str (log_level level) |
log_level | str_to_level (const char *str) |
section_id | register_log_section (const char *name) |
section_id | search_log_section (const char *name) |
bool | check_section_log_level (section_id section, log_level level) |
bool | setlevel (log_level level, const char *name) |
log_level | getlevel (const char *name) |
void | enable_stdout_logging (bool enable) |
bool | stdout_message (log_level lvl, const char *module, const char *message) |
bool | add_logger (struct logger *logger) |
bool | remove_logger (struct logger *logger) |
void | remove_all_logger () |
Logging API.
#define INVALID_SECTION_ID -1 |
Invalid section id.
#define LOG_FATAL | ( | section, | |
fmt, | |||
... | |||
) | LOG(HAKA_LOG_FATAL, section, fmt, ##__VA_ARGS__) |
Log a message with string formating in various level.
typedef int section_id |
Log section identifier.
anonymous enum |
Global section id.
enum log_level |
Log level.
Add a new logger instance in the logger list. Each logger will receive all logging messages that are emitted by the code.
bool check_section_log_level | ( | section_id | section, |
log_level | level | ||
) |
Check if section should be logged.
void enable_stdout_logging | ( | bool | enable | ) |
Change the display of log message on stdout.
log_level getlevel | ( | const char * | name | ) |
Get the logging level for a given section name.
const char* level_to_str | ( | log_level | level | ) |
Convert a logging level to a human readable string.
section_id register_log_section | ( | const char * | name | ) |
Register a log section.
void remove_all_logger | ( | ) |
Remove all loggers.
section_id search_log_section | ( | const char * | name | ) |
Search for a log section by name.
Set the logging level to display for a given section name. The name
parameter can be NULL
in which case it will set the default level.
Show a log line on the stdout.
log_level str_to_level | ( | const char * | str | ) |
Convert a logging level represented by a string to the matching enum value.