|
clogger
Version 2.1.1
API Reference for clogger
|
Standard log functions. More...
Macros | |
| #define | CLOGGER_TRACE() clog_trace(__FUNCTION__, __FILE__, __LINE__) |
Shorthand macro for clog_trace | |
| #define | CLOGGER_TRACE_LINE(line) clog_trace(__FUNCTION__, __FILE__, line) |
Shorthand macto for clog_trace, allowing line specification. | |
Functions | |
| CLoggerInt32 | clog_messagef (CLoggerLevel level, CLogger *logger, const char *location, const char *format, va_list args) |
| The utility log function used throughout the library. More... | |
| void | clog_message (const char *location, const char *message,...) |
| The generic logging message. More... | |
| void | clog_info (const char *location, const char *message,...) |
Log a message representing a CLOGGER_LEVEL_INFO level message. More... | |
| void | clog_debug (const char *location, const char *message,...) |
Log a message representing a CLOGGER_LEVEL_DEBUG level message. More... | |
| void | clog_warning (const char *location, const char *message,...) |
Log a message representing a CLOGGER_LEVEL_WARNING level message. More... | |
| void | clog_error (const char *location, const char *message,...) |
Log a message representing a CLOGGER_LEVEL_ERROR level message. More... | |
| void | clog_critical (const char *location, const char *message,...) |
Log a message representing a CLOGGER_LEVEL_CRITICAL level message. More... | |
| CLoggerBool | clog_append_to_file (const char *file_path, const char *location, const char *message,...) |
| Log message to file. More... | |
| CLoggerBool | clog_prepend_to_file (const char *file_path, const char *location, const char *message,...) |
| Prepend log message to file. More... | |
| void | clog_trace (const char *function_name, const char *file_name, int line) |
| Displays a function traceback message. More... | |
Standard log functions.
| CLoggerInt32 clog_messagef | ( | CLoggerLevel | level, |
| CLogger * | logger, | ||
| const char * | location, | ||
| const char * | format, | ||
| va_list | args | ||
| ) |
The utility log function used throughout the library.
| level | [in] The log level |
| logger | [in] Pointer to a CLogger data structure. Pass NULL if not used |
| location | [in] Location of the log, usually __FUNCTION__ though can be NULL |
| format | [in] String detailing the format |
| args | [in] Variable arguments list to use with the format string |
| void clog_message | ( | const char * | location, |
| const char * | message, | ||
| ... | |||
| ) |
The generic logging message.
| location | [in] Location of the log, usually __FUNCTION__ though can be NULL |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args for the message string |
| void clog_info | ( | const char * | location, |
| const char * | message, | ||
| ... | |||
| ) |
Log a message representing a CLOGGER_LEVEL_INFO level message.
| location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| void clog_debug | ( | const char * | location, |
| const char * | message, | ||
| ... | |||
| ) |
Log a message representing a CLOGGER_LEVEL_DEBUG level message.
| location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| void clog_warning | ( | const char * | location, |
| const char * | message, | ||
| ... | |||
| ) |
Log a message representing a CLOGGER_LEVEL_WARNING level message.
| location | [in] Location of the log, |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| void clog_error | ( | const char * | location, |
| const char * | message, | ||
| ... | |||
| ) |
Log a message representing a CLOGGER_LEVEL_ERROR level message.
| location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| void clog_critical | ( | const char * | location, |
| const char * | message, | ||
| ... | |||
| ) |
Log a message representing a CLOGGER_LEVEL_CRITICAL level message.
| location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
| CLoggerBool clog_append_to_file | ( | const char * | file_path, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
Log message to file.
| file_path | [in] The file path to dump the log message. |
/logs/log.txt | location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
CLOGGER_FALSE on failure or CLOGGER_TRUE on success | CLoggerBool clog_prepend_to_file | ( | const char * | file_path, |
| const char * | location, | ||
| const char * | message, | ||
| ... | |||
| ) |
Prepend log message to file.
| file_path | [in] The file path to dump the log message. |
/logs/log.txt | location | [in] Location of the log |
| message | [in] Format-able string message as you would use printf() |
| ... | [in] Variable-length args |
CLOGGER_FALSE on failure or CLOGGER_TRUE on success | void clog_trace | ( | const char * | function_name, |
| const char * | file_name, | ||
| int | line | ||
| ) |
Displays a function traceback message.
This should be used in sync with the error/critical functions to make debugging/tracing easier as they will not trace back themselves.
| function_name | [in] Name of the function, usually __FUNCTION__ |
| file_name | [in] Name of the file, usually __FILE__ |
| line | [in] The line number, usually __LINE__ (or some variant) |