77 typedef std::map<DbMessageID, isc::log::MessageID>
MessageMap;
125template <log_type_t log_type>
133 formatter_ = formatter(message_id, debug_level);
143 template <
typename T,
typename... Args>
145 formatter_.
arg(first);
166 formatter(
DbMessageID const message_id,
int const debug_level = 0);
173 bool isEnabled(
int const debug_level = 0)
const;
203 :
DB_LOG(message_id, debug_level) {
DbLogger(isc::log::Logger &logger, const MessageMap &map)
Constructor.
const MessageMap & map_
The translation map.
const isc::log::MessageID & translateMessage(const DbMessageID &id) const
Translate message.
std::map< DbMessageID, isc::log::MessageID > MessageMap
Translation map type.
isc::log::Logger & logger_
The logger.
const int DB_DBG_TRACE_DETAIL
Database logging levels.
isc::log::Logger database_logger("database")
Common database library logger.
std::list< DbLogger > DbLoggerStack
Database logger stack.
DbMessageID
Database messages.
@ MYSQL_START_TRANSACTION
@ PGSQL_ROLLBACK_SAVEPOINT
@ MYSQL_INITIALIZE_SCHEMA
@ PGSQL_TCP_USER_TIMEOUT_UNSUPPORTED
@ PGSQL_START_TRANSACTION
@ PGSQL_INITIALIZE_SCHEMA
DbLoggerStack db_logger_stack
Global database logger stack (initialized to database logger)
log_type_t
log type enumerations for use in DB_LOG specializations
std::mutex db_logger_mutex
Global mutex to protect logger stack.
void checkDbLoggerStack()
Check database logger stack.
const DbLogger::MessageMap db_message_map
Map of translated messages.
DbLogger db_logger_translator(database_logger, db_message_map)
Database logger translator.
Defines the logger used by the top-level component of kea-lfc.
DB_LOG_DEBUG(int const debug_level, DbMessageID const message_id)
DB_LOG_ERROR(DbMessageID const message_id)
all DB_LOG specializations
DB_LOG_FATAL(DbMessageID const message_id)
DB_LOG_INFO(DbMessageID const message_id)
DB_LOG_WARN(DbMessageID const message_id)
DB_LOG & arg(T first, Args... args)
Pass parameters to replace logger placeholders.
DB_LOG & arg()
The last invocation of the arg() which is without parameters.
DB_LOG(DbMessageID const message_id, int const debug_level=0)
To preserve the old way of logging, this constructor facilitates initiating the DB_LOG_* chain call.