From 7890312d0a850ffc5be20d078d7e8f2d148dca3e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 31 Aug 2009 21:21:09 +0200 Subject: =?UTF-8?q?LogManager=20=C3=BCberarbeitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/ModuleManager.cpp | 8 +++---- .../RequestHandlers/DisconnectRequestHandler.cpp | 2 +- .../RequestHandlers/SimpleRequestHandler.cpp | 2 +- .../RequestHandlers/SimpleRequestHandlerGroup.cpp | 2 +- src/Common/RequestManager.cpp | 8 +++---- src/Common/UserCache.cpp | 12 +++++----- src/Common/UserManager.cpp | 28 +++++++++++----------- 7 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src/Common') diff --git a/src/Common/ModuleManager.cpp b/src/Common/ModuleManager.cpp index 057af1f..78a6459 100644 --- a/src/Common/ModuleManager.cpp +++ b/src/Common/ModuleManager.cpp @@ -64,7 +64,7 @@ bool ModuleManager::handleConfigEntry(const Core::ConfigEntry &entry, bool handl if(entry[0].getKey().matches("LoadModule") && entry[1].empty()) { if(!loadModule(entry[0][0].c_str())) - application->logf(Core::LoggerBase::LOG_ERROR, "Can't load module '%s'.", entry[0][0].c_str()); + application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", entry[0][0].c_str()); return true; } @@ -96,7 +96,7 @@ bool ModuleManager::loadModule(const std::string &name) { #ifdef WIN32 application->logf(Core::LoggerBase::LOG_VERBOSE, "loadModule: Can't open module: Error %u", GetLastError()); #else - application->log(Core::LoggerBase::LOG_VERBOSE, std::string("loadModule: Can't open module: ") + std::string(dlerror())); + application->log(Core::Logger::LOG_VERBOSE, std::string("loadModule: Can't open module: ") + std::string(dlerror())); #endif return false; } @@ -111,14 +111,14 @@ bool ModuleManager::loadModule(const std::string &name) { #endif if(!loader) { - application->log(Core::LoggerBase::LOG_VERBOSE, "loadModule: Can't open module: Invalid module"); + application->log(Core::Logger::LOG_VERBOSE, "loadModule: Can't open module: Invalid module"); return false; } Module *mod = loader(application); if(!mod) { - application->log(Core::LoggerBase::LOG_VERBOSE, "loadModule: Can't open module: Internal module error"); + application->log(Core::Logger::LOG_VERBOSE, "loadModule: Can't open module: Internal module error"); return false; } } diff --git a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp index a1ecd5a..d6b3449 100644 --- a/src/Common/RequestHandlers/DisconnectRequestHandler.cpp +++ b/src/Common/RequestHandlers/DisconnectRequestHandler.cpp @@ -26,7 +26,7 @@ namespace RequestHandlers { void DisconnectRequestHandler::handlePacket(boost::shared_ptr packet) { if(packet->getType() != "Disconnect") { - getApplication()->log(Core::LoggerBase::LOG_ERROR, "Received an unexpected packet."); + getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); XmlPacket ret; ret.setType("Error"); diff --git a/src/Common/RequestHandlers/SimpleRequestHandler.cpp b/src/Common/RequestHandlers/SimpleRequestHandler.cpp index 789db9e..33dfd5a 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandler.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandler.cpp @@ -27,7 +27,7 @@ namespace RequestHandlers { void SimpleRequestHandler::handlePacket(boost::shared_ptr packet) { if(packet->getType() != type) { - getApplication()->log(Core::LoggerBase::LOG_ERROR, "Received an unexpected packet."); + getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); XmlPacket ret; ret.setType("Error"); diff --git a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp index 261950d..4d6a0e4 100644 --- a/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp +++ b/src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp @@ -28,7 +28,7 @@ namespace RequestHandlers { void SimpleRequestHandlerGroup::GroupRequestHandler::handlePacket(boost::shared_ptr packet) { if(packet->getType() != type) { - getApplication()->log(Core::LoggerBase::LOG_ERROR, "Received an unexpected packet."); + getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); XmlPacket ret; ret.setType("Error"); diff --git a/src/Common/RequestManager.cpp b/src/Common/RequestManager.cpp index c30ddc2..66c06b4 100644 --- a/src/Common/RequestManager.cpp +++ b/src/Common/RequestManager.cpp @@ -99,7 +99,7 @@ void RequestManager::receiveHandler(Connection *connection, boost::shared_ptrlog(Core::LoggerBase::LOG_ERROR, "Received a packet from an unregistered connection."); + application->log(Core::Logger::LOG_ERROR, "Received a packet from an unregistered connection."); return; } @@ -126,7 +126,7 @@ void RequestManager::receiveHandler(Connection *connection, boost::shared_ptrlogf(Core::LoggerBase::LOG_ERROR, "Received an unexpected packet with type '%s'.", packet->getType().c_str()); + application->logf(Core::Logger::LOG_ERROR, "Received an unexpected packet with type '%s'.", packet->getType().c_str()); XmlPacket ret; ret.setType("Error"); @@ -139,14 +139,14 @@ bool RequestManager::sendRequest(Connection *connection, boost::shared_ptr lock(mutex); if(!requestMap.isConnectionRegistered(connection)) { - application->log(Core::LoggerBase::LOG_CRITICAL, "Trying to send a request over an unregistered connecion."); + application->log(Core::Logger::LOG_CRITICAL, "Trying to send a request over an unregistered connecion."); return false; } boost::uint16_t requestId = _getUnusedRequestId(connection); if(request->isFinished || !requestMap.addRequest(connection, requestId, request)) { - application->log(Core::LoggerBase::LOG_CRITICAL, "Trying resend a request."); + application->log(Core::Logger::LOG_CRITICAL, "Trying resend a request."); return false; } request->connectSignalFinished(boost::bind(&RequestManager::handleRequestFinished, this, connection, requestId)); diff --git a/src/Common/UserCache.cpp b/src/Common/UserCache.cpp index 1367041..e2bb575 100644 --- a/src/Common/UserCache.cpp +++ b/src/Common/UserCache.cpp @@ -42,9 +42,9 @@ boost::shared_ptr > UserCache::getUserLi } else { if(users) - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_DEBUG, "Using cached user list"); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_DEBUG, "Using cached user list"); else - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_DEBUG, "Error cached"); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_DEBUG, "Error cached"); } } catch(Core::Exception e) { @@ -133,9 +133,9 @@ boost::shared_ptr > UserCache::getGroup } else { if(groups) - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_DEBUG, "Using cached group list"); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_DEBUG, "Using cached group list"); else - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_DEBUG, "Error cached"); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_DEBUG, "Error cached"); } } catch(Core::Exception e) { @@ -223,9 +223,9 @@ boost::shared_ptr > UserCache: } else { if(userGroups) - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_DEBUG, "Using cached user-group table"); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_DEBUG, "Using cached user-group table"); else - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_DEBUG, "Error cached"); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_DEBUG, "Error cached"); } } catch(Core::Exception e) { diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp index d184044..f112894 100644 --- a/src/Common/UserManager.cpp +++ b/src/Common/UserManager.cpp @@ -43,7 +43,7 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl char *endptr; unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); if(entry[1][0].empty() || *endptr) { - application->logf(Core::LoggerBase::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].c_str()); + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].c_str()); } else { minUid = val; @@ -55,7 +55,7 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl char *endptr; unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); if(entry[1][0].empty() || *endptr) { - application->logf(Core::LoggerBase::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].c_str()); + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].c_str()); } else { maxUid = val; @@ -67,7 +67,7 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl char *endptr; unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); if(entry[1][0].empty() || *endptr) { - application->logf(Core::LoggerBase::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].c_str()); + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].c_str()); } else { minGid = val; @@ -79,7 +79,7 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl char *endptr; unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10); if(entry[1][0].empty() || *endptr) { - application->logf(Core::LoggerBase::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].c_str()); + application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].c_str()); } else { maxGid = val; @@ -234,7 +234,7 @@ void UserManager::addUser(const UserInfo &userInfo) throw(Core::Exception) { (*configBackend)->addUser(userInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -258,7 +258,7 @@ void UserManager::updateUser(unsigned long uid, const UserInfo &userInfo) throw( (*configBackend)->updateUser(*oldUserInfo, userInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -280,7 +280,7 @@ void UserManager::deleteUser(unsigned long uid) throw(Core::Exception) { (*configBackend)->deleteUser(*userInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -317,7 +317,7 @@ void UserManager::addGroup(const GroupInfo &groupInfo) throw(Core::Exception) { (*configBackend)->addGroup(groupInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -341,7 +341,7 @@ void UserManager::updateGroup(unsigned long gid, const GroupInfo &groupInfo) thr (*configBackend)->updateGroup(*oldGroupInfo, groupInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -363,7 +363,7 @@ void UserManager::deleteGroup(unsigned long gid) throw(Core::Exception) { (*configBackend)->deleteGroup(*groupInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -388,7 +388,7 @@ void UserManager::addUserToGroup(unsigned long uid, unsigned long gid) throw(Cor (*configBackend)->addUserToGroup(*userInfo, *groupInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -413,7 +413,7 @@ void UserManager::deleteUserFromGroup(unsigned long uid, unsigned long gid) thro (*configBackend)->deleteUserFromGroup(*userInfo, *groupInfo); } catch(Core::Exception e) { - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } } @@ -439,7 +439,7 @@ void UserManager::setPassword(unsigned long uid, const std::string &password) th exception = e; if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } for(std::set >::iterator configBackend = configBackends.begin(); configBackend != configBackends.end(); ++configBackend) { @@ -449,7 +449,7 @@ void UserManager::setPassword(unsigned long uid, const std::string &password) th } catch(Core::Exception e) { if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) - application->log(Core::LoggerBase::LOG_USER, Core::LoggerBase::LOG_WARNING, e.what()); + application->log(Core::Logger::LOG_USER, Core::Logger::LOG_WARNING, e.what()); } } -- cgit v1.2.3