Was this page helpful?
Caution
You're viewing documentation for an unstable version of ScyllaDB CPP RS Driver. Switch to the latest stable version.
Logging¶
-
enum CassLogLevel¶
Values:
-
enumerator CASS_LOG_DISABLED¶
-
enumerator CASS_LOG_CRITICAL¶
-
enumerator CASS_LOG_ERROR¶
-
enumerator CASS_LOG_WARN¶
-
enumerator CASS_LOG_INFO¶
-
enumerator CASS_LOG_DEBUG¶
-
enumerator CASS_LOG_TRACE¶
-
enumerator CASS_LOG_DISABLED¶
-
typedef void (*CassLogCallback)(const CassLogMessage *message, void *data)¶
A callback that’s used to handle logging.
See also
- Param message:
[in]
- Param data:
[in] user defined data provided when the callback was registered.
-
void cass_log_set_level(CassLogLevel log_level)¶
Sets the log level.
Note: This needs to be done before any call that might log, such as any of the cass_cluster_*() or cass_ssl_*() functions.
Default: CASS_LOG_WARN
- Parameters:
log_level – [in]
-
void cass_log_set_callback(CassLogCallback callback, void *data)¶
Sets a callback for handling logging events.
Note: This needs to be done before any call that might log, such as any of the cass_cluster_*() or cass_ssl_*() functions.
Default: An internal callback that prints to stderr
- Parameters:
data – [in] An opaque data object passed to the callback.
callback – [in] A callback that handles logging events. This is called in a separate thread so access to shared data must be synchronized.
-
void cass_log_get_callback_and_data(CassLogCallback *callback_out, void **data_out)¶
Analogous getter - useful for restoring logger to previous values.
- Parameters:
callback_out – [out] Current logging callback. Must point to a valid memory area.
data_out – [out] Current Logger instance. Must point to a valid memory area.
-
const char *cass_log_level_string(CassLogLevel log_level)¶
Gets the string for a log level.
- Parameters:
log_level – [in]
- Returns:
A null-terminated string for the log level. Example: “ERROR”, “WARN”, “INFO”, etc.
-
struct CassLogMessage¶
- #include <cassandra.h>
A log message.
Public Members
-
cass_uint64_t time_ms¶
The millisecond timestamp (since the Epoch) when the message was logged
-
CassLogLevel severity¶
The severity of the log message
-
const char *file¶
The file where the message was logged
-
int line¶
The line in the file where the message was logged
-
const char *function¶
The function where the message was logged
-
char message[1024]¶
The message
-
cass_uint64_t time_ms¶