Typedefs | |
typedef void(* | ctl_log_cb )(void *ctx, ctl_loglevel level, const char *fmt, va_list ap) |
Callback type for logging. | |
Enumerations | |
enum | ctl_loglevel { ctl_LOG_FINEST = 1, ctl_LOG_FINER, ctl_LOG_DEBUG, ctl_LOG_INFO, ctl_LOG_NOTIFY, ctl_LOG_WARN, ctl_LOG_ERROR, ctl_LOG_CRITICAL, ctl_LOG_CONFIG } |
Enumeration that represents the available logging levels. More... | |
Functions | |
void | ctl_set_log_callback (ctl_provider *provider, ctl_log_cb callback, void *ctx) |
Set the log callback function. | |
void | ctl_log (ctl_provider *provider, ctl_loglevel level, const char *fmt,...) |
Log a message to the logfile for the provider. | |
const char * | ctl_loglevel_tostring (ctl_loglevel level) |
Return a textual description for the given log level. | |
const char * | ctl_error_tostring (ctl_error error) |
Return a textual description for the given error code. | |
char * | ctl_trade_tostring (ctl_trade *trade, char *buf, size_t buflen) |
Create a string representation of a ctl_trade object. | |
char * | ctl_channel_tostring (ctl_channel *channel, char *buf, size_t buflen) |
Create a string representation of a ctl_channel object. | |
char * | ctl_tradeevent_tostring (ctl_tradeevent *ev, char *buf, size_t buflen) |
Create a string representation of a ctl_tradeevent object. |
typedef void(* ctl_log_cb)(void *ctx, ctl_loglevel level, const char *fmt, va_list ap) |
Callback type for logging.
ctx | - Your specified callback context | |
level | - The level that this log message should be logged at | |
fmt | - A standard printf style format string | |
ap | - Variadic arguments |
enum ctl_loglevel |
Enumeration that represents the available logging levels.
See ctl_loglevel_tostring() which returns a textual description of the logging level.
char* ctl_channel_tostring | ( | ctl_channel * | channel, | |
char * | buf, | |||
size_t | buflen | |||
) |
Create a string representation of a ctl_channel object.
channel | - The channel to create a string represenation of | |
buf | - Buffer to serialise into | |
buflen | - Size of the buffer |
const char* ctl_error_tostring | ( | ctl_error | error | ) |
Return a textual description for the given error code.
error | - Error code |
void ctl_log | ( | ctl_provider * | provider, | |
ctl_loglevel | level, | |||
const char * | fmt, | |||
... | ||||
) |
Log a message to the logfile for the provider.
provider | - The provider to log for | |
level | - The log level | |
fmt | - Printf style argument |
const char* ctl_loglevel_tostring | ( | ctl_loglevel | level | ) |
Return a textual description for the given log level.
level | - Log level |
void ctl_set_log_callback | ( | ctl_provider * | provider, | |
ctl_log_cb | callback, | |||
void * | ctx | |||
) |
Set the log callback function.
provider | - The provider to register the callback for | |
callback | - Callback function | |
ctx | - Callback context |
If provider is NULL, then the default log callback will be set for the whole library.
char* ctl_trade_tostring | ( | ctl_trade * | trade, | |
char * | buf, | |||
size_t | buflen | |||
) |
Create a string representation of a ctl_trade object.
trade | - The trade to create a string represenation of | |
buf | - Buffer to serialise into | |
buflen | - Size of the buffer |
char* ctl_tradeevent_tostring | ( | ctl_tradeevent * | ev, | |
char * | buf, | |||
size_t | buflen | |||
) |
Create a string representation of a ctl_tradeevent object.
ev | - The tradevent to create a string represenation of | |
buf | - Buffer to serialise into | |
buflen | - Size of the buffer |