7 #ifndef LOG_FORMATTER_H 8 #define LOG_FORMATTER_H 15 #include <boost/lexical_cast.hpp> 63 const unsigned placeholder);
113 std::string* message_;
116 unsigned nextPlaceholder_;
136 logger_(
logger), severity_(severity), message_(message),
147 logger_(other.logger_), severity_(other.severity_),
148 message_(other.message_), nextPlaceholder_(other.nextPlaceholder_)
150 other.logger_ = NULL;
160 logger_->output(severity_, *message_);
173 if (&other !=
this) {
174 logger_ = other.logger_;
175 severity_ = other.severity_;
176 message_ = other.message_;
177 nextPlaceholder_ = other.nextPlaceholder_;
178 other.logger_ = NULL;
194 return (
arg(boost::lexical_cast<std::string>(value)));
195 }
catch (
const boost::bad_lexical_cast& ex) {
208 "Formatter::arg(): " << ex.
what());
void replacePlaceholder(string *message, const string &arg, const unsigned placeholder)
The internal replacement routine.
MismatchedPlaceholders(const char *file, size_t line, const char *what)
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::log::Logger logger("asiodns")
Use the ASIO logger.
void checkExcessPlaceholders(string *message, unsigned int placeholder)
Internal excess placeholder checker.