|
clogger
Version 2.1.1
API Reference for clogger
|
File for use with the CLogger structure.
More...
Enumerations | |
| enum | CLoggerFileOpt { CLOGGER_FILE_OPT_OFF = CLOGGER_FILE_OPT_OFF_BITS, CLOGGER_FILE_OPT_PREPEND, CLOGGER_FILE_OPT_INFO, CLOGGER_FILE_OPT_DEBUG, CLOGGER_FILE_OPT_WARNING, CLOGGER_FILE_OPT_ERROR, CLOGGER_FILE_OPT_CRITICAL, CLOGGER_FILE_OPT_ASSERT, CLOGGER_FILE_OPT_EXPECT, CLOGGER_FILE_OPT_DEFAULT = CLOGGER_FILE_OPT_DEFAULT_BITS } |
| Enumeration of bit flags for CLogger::file_opt. More... | |
Functions | |
| void | clogger_init (CLogger *logger, const char *clogger_name) |
| Creates a logger instance. More... | |
| void | clogger_init_filepath (CLogger *logger, const char *clogger_name, const char *file_path) |
| Creates a logger instance with a specific filepath. More... | |
| void | clogger_set_error_callback (CLogger *logger, void(*callback)(CLoggerLevel level, const char *clogger_name, const char *location)) |
| Sets error callback function. More... | |
| void | clogger_set_assert_fail_callback (CLogger *logger, void(*callback)()) |
| Sets callback function for assert fail. More... | |
| void | clogger_info (CLogger *logger, const char *location, const char *message,...) |
CLOG_LEVEL_INFO log message, will only call if the CLogger struct is set as such More... | |
| void | clogger_debug (CLogger *logger, const char *location, const char *message,...) |
CLOG_LEVEL_DEBUG log message, will only call if the CLogger struct is set as such More... | |
| void | clogger_warning (CLogger *logger, const char *location, const char *message,...) |
CLOG_LEVEL_WARNING log message, will only call if the CLogger struct is set as such More... | |
| void | clogger_error (CLogger *logger, const char *location, const char *message,...) |
CLOG_LEVEL_ERROR log message, will only call if the CLogger struct is set as such More... | |
| void | clogger_critical (CLogger *logger, const char *location, const char *message,...) |
CLOG_LEVEL_CRITICAL log message, will only call if the CLogger struct is set as such More... | |
| void | clogger_assert (CLogger *logger, CLoggerBool condition, const char *location, const char *message,...) |
CLOG_LEVEL_FATAL_ASSERT log message, will only call if the condition fails More... | |
| CLoggerBool | clogger_expect (CLogger *logger, CLoggerBool condition, const char *location, const char *message,...) |
CLOG_LEVEL_NON_FATAL_ASSERT log message, will only call if the condition fails More... | |
| void | clogger_set_file_opt_option (CLogger *logger, CLoggerFileOpt option, CLoggerBool enabled) |
Set the CLogger::file_opt More... | |
File for use with the CLogger structure.
| enum CLoggerFileOpt |
Enumeration of bit flags for CLogger::file_opt.
| Enumerator | |
|---|---|
| CLOGGER_FILE_OPT_OFF | Turns off all |
| CLOGGER_FILE_OPT_PREPEND | Determines whether the |
| CLOGGER_FILE_OPT_INFO | Determines whether the |
| CLOGGER_FILE_OPT_DEBUG | Determines whether the |
| CLOGGER_FILE_OPT_WARNING | Determines whether the |
| CLOGGER_FILE_OPT_ERROR | Determines whether the |
| CLOGGER_FILE_OPT_CRITICAL | Determines whether the |
| CLOGGER_FILE_OPT_ASSERT | Determines whether the |
| CLOGGER_FILE_OPT_EXPECT | Determines whether the |
| CLOGGER_FILE_OPT_DEFAULT | Default |
| void clogger_init | ( | CLogger * | logger, |
| const char * | clogger_name | ||
| ) |
Creates a logger instance.
| logger | [in, out] Pointer to CLogger to initialise |
| clogger_name | [in] Name of the logger |
| void clogger_init_filepath | ( | CLogger * | logger, |
| const char * | clogger_name, | ||
| const char * | file_path | ||
| ) |
| void clogger_set_error_callback | ( | CLogger * | logger, |
| void(*)(CLoggerLevel level, const char *clogger_name, const char *location) | callback | ||
| ) |
Sets error callback function.
| logger | [in, out] Pointer to CLogger data structure |
| callback | [in] Callback function to set |
| void clogger_set_assert_fail_callback | ( | CLogger * | logger, |
| void(*)() | callback | ||
| ) |
Sets callback function for assert fail.
| logger | [in, out] Pointer to CLogger data structure |
| callback | [in] Callback function to set |
| void clogger_info | ( | CLogger * | logger, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
| void clogger_debug | ( | CLogger * | logger, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
| void clogger_warning | ( | CLogger * | logger, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
| void clogger_error | ( | CLogger * | logger, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
| void clogger_critical | ( | CLogger * | logger, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
| void clogger_assert | ( | CLogger * | logger, |
| CLoggerBool | condition, | ||
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
CLOG_LEVEL_FATAL_ASSERT log message, will only call if the condition fails
If the condition fails, the function pointed to in CLogger::assert_fail will be invoked. By default, this is the exit() function.
| logger | [in] Pointer to CLogger data structure |
| condition | [in] Condition to evaluate |
| location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| CLoggerBool clogger_expect | ( | CLogger * | logger, |
| CLoggerBool | condition, | ||
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
CLOG_LEVEL_NON_FATAL_ASSERT log message, will only call if the condition fails
| logger | [in] Pointer to CLogger data structure |
| condition | [in] Condition to evaluate |
| location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| void clogger_set_file_opt_option | ( | CLogger * | logger, |
| CLoggerFileOpt | option, | ||
| CLoggerBool | enabled | ||
| ) |
Set the CLogger::file_opt
| logger | Pointer to the CLogger to set the option for |
| option | Flags |
| enabled | Enable or disable |