42 int& initDebugLevel() {
43 static int dbglevel = 0;
47 std::string& initRootName() {
59 LoggerManager::LoggerManager() {
64 LoggerManager::~LoggerManager() {
70 LoggerManager::processInit() {
76 LoggerManager::processSpecification(
const LoggerSpecification& spec) {
77 impl_->processSpecification(spec);
82 LoggerManager::processEnd() {
91 int dbglevel,
const char* file,
bool buffer)
95 MessageInitializer::loadDictionary();
100 initRootName() = root;
101 initSeverity() = severity;
102 initDebugLevel() = dbglevel;
113 LoggerManagerImpl::init(severity, dbglevel, buffer);
118 logDuplicatedMessages();
122 readLocalMessageFile(file);
130 LoggerManager::logDuplicatedMessages() {
131 const list<string>& duplicates = MessageInitializer::getDuplicates();
132 if (!duplicates.empty()) {
137 for (list<string>::const_iterator i = duplicates.begin();
138 i != duplicates.end(); ++i) {
141 MessageInitializer::clearDuplicates();
150 LoggerManager::readLocalMessageFile(
const char* file) {
165 reader.readFile(file, MessageReader::REPLACE);
172 for (MessageReader::MessageIDCollection::const_iterator
173 i = unknown.begin(); i != unknown.end(); ++i) {
174 string message_id = boost::lexical_cast<string>(*i);
185 for (vector<string>::size_type i = 0; i < args.size(); ++i) {
186 error_message = error_message.
arg(args[i]);
193 LoggerManager::reset() {
195 LoggerManagerImpl::reset(initSeverity(), initDebugLevel());
199 LoggerManager::getMutex() {
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
std::vector< std::string > arguments() const
Return Arguments.
const std::string & getDefaultRootLoggerName()
Returns the default ('kea') root logger name.
Logger Manager Implementation.
void setRootLoggerName(const std::string &name)
Set root logger name.
void setLoggingInitialized(bool state)
Set state of "logging initialized" flag.
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.
Mutex with very simple interface.
Logging initialization functions.
Formatter error(const MessageID &ident)
Output Error Message.
MessageID id() const
Return Message ID.
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.