32 #ifdef LOG4CPLUS_INITIALIZER_H
33 #include <log4cplus/initializer.h>
52 int& initDebugLevel() {
53 static int dbglevel = 0;
57 std::string& initRootName() {
69 LoggerManager::LoggerManager() {
74 LoggerManager::~LoggerManager() {
80 LoggerManager::processInit() {
86 LoggerManager::processSpecification(
const LoggerSpecification& spec) {
87 impl_->processSpecification(spec);
92 LoggerManager::processEnd() {
101 int dbglevel,
const char* file,
bool buffer)
105 MessageInitializer::loadDictionary();
110 initRootName() = root;
111 initSeverity() = severity;
112 initDebugLevel() = dbglevel;
123 LoggerManagerImpl::init(severity, dbglevel, buffer);
128 logDuplicatedMessages();
132 readLocalMessageFile(file);
140 LoggerManager::logDuplicatedMessages() {
141 const list<string>& duplicates = MessageInitializer::getDuplicates();
142 if (!duplicates.empty()) {
147 for (list<string>::const_iterator i = duplicates.begin();
148 i != duplicates.end(); ++i) {
151 MessageInitializer::clearDuplicates();
160 LoggerManager::readLocalMessageFile(
const char* file) {
175 reader.readFile(file, MessageReader::REPLACE);
182 for (MessageReader::MessageIDCollection::const_iterator
183 i = unknown.begin(); i != unknown.end(); ++i) {
184 string message_id = boost::lexical_cast<
string>(*i);
195 for (vector<string>::size_type i = 0; i < args.size(); ++i) {
196 error_message = error_message.
arg(args[i]);
203 LoggerManager::reset() {
205 LoggerManagerImpl::reset(initSeverity(), initDebugLevel());
209 LoggerManager::getMutex() {
210 static std::mutex mutex;
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
const std::string & getDefaultRootLoggerName()
Returns the default ('kea') root logger name.
Logger Manager Implementation.
void setRootLoggerName(const std::string &name)
Set root logger name.
std::vector< std::string > arguments() const
Return Arguments.
void setLoggingInitialized(bool state)
Set state of "logging initialized" flag.
MessageID id() const
Return Message ID.
const isc::log::MessageID LOG_READING_LOCAL_FILE
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::log::Logger logger("asiodns")
Use the ASIO logger.
Logging initialization functions.
Formatter error(const MessageID &ident)
Output Error Message.
boost::shared_ptr< MessageDictionary > MessageDictionaryPtr
Shared pointer to the MessageDictionary.
Formatter warn(const MessageID &ident)
Output Warning Message.
const isc::log::MessageID LOG_DUPLICATE_MESSAGE_ID
Formatter info(const MessageID &ident)
Output Informational Message.
const isc::log::MessageID LOG_NO_SUCH_MESSAGE
void setInterprocessSync(isc::log::interprocess::InterprocessSync *sync)
Replace the interprocess synchronization object.
Null Interprocess Sync Class.
std::vector< std::string > MessageIDCollection
Visible collection types.