quasardb C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Typedefs | Enumerations | Functions
Logging-related operations

Typedefs

typedef size_t qdb_log_callback_id
 An unique callback identifier returned by qdb_log_add_callback. More...
 
typedef void(* qdb_log_callback )(qdb_log_level_t, const unsigned long *, unsigned long, unsigned long, const char *, size_t)
 A typedef representing a log callback. More...
 

Enumerations

enum  qdb_log_level_t {
  qdb_log_detailed = 100, qdb_log_debug = 200, qdb_log_info = 300, qdb_log_warning = 400,
  qdb_log_error = 500, qdb_log_panic = 600
}
 An enumeration of log level. More...
 

Functions

QDB_API_LINKAGE qdb_error_t qdb_log_add_callback (qdb_log_callback cb, qdb_log_callback_id *callback_id)
 Adds a callback that will receive internal API log messages. This can be used to incorporate internal API statuses in your log. More...
 
QDB_API_LINKAGE qdb_error_t qdb_log_remove_callback (qdb_log_callback_id callback_id)
 Removes a previously added log callback. More...
 
QDB_API_LINKAGE int qdb_log_option_is_sync (void)
 Indicates if logs are synchronized for each API call (disabled by default). More...
 
QDB_API_LINKAGE void qdb_log_option_set_sync (int sync_logger)
 Set logs to be synchronous for each API call (disabled by default). More...
 

Detailed Description

Typedef Documentation

qdb_log_callback

A typedef representing a log callback.

See Also
qdb_log_add_callback, qdb_log_remove_callback

An unique callback identifier returned by qdb_log_add_callback.

See Also
qdb_log_add_callback, qdb_log_remove_callback

Enumeration Type Documentation

An enumeration of log level.

See Also
qdb_open
qdb_log_callback
Enumerator
qdb_log_detailed 

Log everything. Very verbose.

qdb_log_debug 

Log debug level messages and below.

qdb_log_info 

Log information level messages and below.

qdb_log_warning 

Log warning level messages and below.

qdb_log_error 

Log error level messages and below.

qdb_log_panic 

Log panic level messages and below. Very terse.

Function Documentation

QDB_API_LINKAGE qdb_error_t qdb_log_add_callback ( qdb_log_callback  cb,
qdb_log_callback_id callback_id 
)

Adds a callback that will receive internal API log messages. This can be used to incorporate internal API statuses in your log.

Parameters
cbA callback of type qdb_log_callback. The callback will be called every time the API emits a log message.
callback_idA pointer to a unique callback identifier that can be used to remove the callback.
Returns
A qdb_error_t code indicating success or failure.
See Also
qdb_log_callback, qdb_log_remove_callback
QDB_API_LINKAGE int qdb_log_option_is_sync ( void  )

Indicates if logs are synchronized for each API call (disabled by default).

Returns
1 if logs are flushed before returning from each API call, 0 otherwise.
Warning
This function is still under development. Performance and compatibility are not guaranteed.
QDB_API_LINKAGE void qdb_log_option_set_sync ( int  sync_logger)

Set logs to be synchronous for each API call (disabled by default).

Parameters
sync_logger1 if logs must be flushed before returning from each API call, 0 otherwise.
Warning
This function is still under development. Performance and compatibility are not guaranteed.
QDB_API_LINKAGE qdb_error_t qdb_log_remove_callback ( qdb_log_callback_id  callback_id)

Removes a previously added log callback.

Parameters
callback_idThe identifier set by qdb_log_add_callback that will determine which callback to remove.
Returns
A qdb_error_t code indicating success or failure.
See Also
qdb_log_callback, qdb_log_add_callback