7 #ifndef LOG_FORMATTER_H
8 #define LOG_FORMATTER_H
17 #include <boost/make_shared.hpp>
18 #include <boost/shared_ptr.hpp>
19 #include <boost/lexical_cast.hpp>
66 const unsigned placeholder);
116 boost::shared_ptr<std::string> message_;
119 unsigned nextPlaceholder_;
138 boost::shared_ptr<std::string> message = boost::make_shared<std::string>(),
140 logger_(
logger), severity_(severity), message_(message),
141 nextPlaceholder_(0) {
150 logger_(other.logger_), severity_(other.severity_),
151 message_(other.message_), nextPlaceholder_(other.nextPlaceholder_) {
152 other.logger_ = NULL;
162 logger_->output(severity_, *message_);
174 if (&other !=
this) {
175 logger_ = other.logger_;
176 severity_ = other.severity_;
177 message_ = other.message_;
178 nextPlaceholder_ = other.nextPlaceholder_;
179 other.logger_ = NULL;
195 return (
arg(boost::lexical_cast<std::string>(value)));
196 }
catch (
const boost::bad_lexical_cast& ex) {
209 "Formatter::arg(): " << ex.
what());
MismatchedPlaceholders(const char *file, size_t line, const char *what)
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.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
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(std::string &message, unsigned int placeholder)
Internal excess placeholder checker.