12 #ifdef ENABLE_LOGGER_CHECKS
17 using namespace boost;
24 const unsigned placeholder) {
25 const string mark(
"%" + lexical_cast<string>(placeholder));
26 size_t pos(message.find(mark));
27 if (pos != string::npos) {
29 message.replace(pos, mark.size(), arg);
30 pos = message.find(mark, pos + arg.size());
31 }
while (pos != string::npos);
33 #ifdef ENABLE_LOGGER_CHECKS
37 "Missing logger placeholder in message: " << message);
42 message.append(
" @@Missing placeholder " + mark +
" for '" + arg +
"'@@");
49 unsigned int placeholder) {
50 const string mark(
"%" + lexical_cast<string>(placeholder));
51 const size_t pos(message.find(mark));
52 if (pos != string::npos) {
57 #ifdef ENABLE_LOGGER_CHECKS
60 cerr <<
"Message " << message << endl;
61 assert(
"Excess logger placeholders still exist in message" == NULL);
63 message.append(
" @@Excess logger placeholders still exist@@");
void replacePlaceholder(std::string &message, const string &arg, const unsigned placeholder)
The internal replacement routine.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void checkExcessPlaceholders(std::string &message, unsigned int placeholder)
Internal excess placeholder checker.