57 }
catch (
const std::out_of_range&) {
63 if (db_logger_stack.empty()) {
70 DB_LOG<fatal>::formatter(
DbMessageID const message_id,
78 DB_LOG<error>::formatter(
DbMessageID const message_id,
86 DB_LOG<warn>::formatter(
DbMessageID const message_id,
94 DB_LOG<info>::formatter(
DbMessageID const message_id,
102 DB_LOG<debug>::formatter(
DbMessageID const message_id,
103 int const debug_level ) {
111 DB_LOG<fatal>::isEnabled(
int const )
const {
112 return db_logger_stack.back().logger_.isFatalEnabled();
117 DB_LOG<error>::isEnabled(
int const )
const {
118 return db_logger_stack.back().logger_.isErrorEnabled();
123 DB_LOG<warn>::isEnabled(
int const )
const {
124 return db_logger_stack.back().logger_.isWarnEnabled();
129 DB_LOG<info>::isEnabled(
int const )
const {
130 return db_logger_stack.back().logger_.isInfoEnabled();
135 DB_LOG<debug>::isEnabled(
int const debug_level )
const {
136 return db_logger_stack.back().logger_.isDebugEnabled(debug_level);
We want to reuse the database backend connection and exchange code for other uses, in particular for hook libraries.
DbMessageID
Database messages.
const isc::log::MessageID DATABASE_CQL_CONNECTION_ROLLBACK
const isc::log::MessageID DATABASE_PGSQL_COMMIT
const isc::log::MessageID DATABASE_PGSQL_DEALLOC_ERROR
const DbLogger::MessageMap db_message_map
Map of translated messages.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
std::map< DbMessageID, isc::log::MessageID > MessageMap
Translation map type.
const isc::log::MessageID DATABASE_CQL_CONNECTION_COMMIT
std::mutex db_logger_mutex
Global mutex to protect logger stack.
A generic exception that is thrown when an unexpected error condition occurs.
std::list< DbLogger > DbLoggerStack
Database logger stack.
DbLoggerStack db_logger_stack
Global database logger stack (initialized to database logger)
const isc::log::MessageID DATABASE_PGSQL_FATAL_ERROR
const isc::log::MessageID DATABASE_MYSQL_ROLLBACK
const int DB_DBG_TRACE_DETAIL
Database logging levels.
Defines the logger used by the top-level component of kea-dhcp-ddns.
const isc::log::MessageID DATABASE_PGSQL_ROLLBACK
const isc::log::MessageID DATABASE_CQL_CONNECTION_BEGIN_TRANSACTION
const isc::log::MessageID DATABASE_MYSQL_FATAL_ERROR
const isc::log::MessageID DATABASE_MYSQL_COMMIT
void checkDbLoggerStack()
Check database logger stack.
DbLogger db_logger_translator(database_logger, db_message_map)
Database logger translator.
isc::log::Logger database_logger("database")
Common database library logger.
const int DBGLVL_TRACE_DETAIL
Trace detailed operations.
const isc::log::MessageID DATABASE_MYSQL_START_TRANSACTION
const isc::log::MessageID DATABASE_PGSQL_START_TRANSACTION
const isc::log::MessageID DATABASE_CQL_DEALLOC_ERROR
const isc::log::MessageID DATABASE_INVALID_ACCESS