summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-08-31 21:21:09 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-08-31 21:21:09 +0200
commit7890312d0a850ffc5be20d078d7e8f2d148dca3e (patch)
treea466ac9d3d0a8ecde06fa5c03b154480361cfdf5 /src/Common
parent053843f893dd5c96a88e285cf2a5b35419f7dfca (diff)
downloadmad-7890312d0a850ffc5be20d078d7e8f2d148dca3e.tar
mad-7890312d0a850ffc5be20d078d7e8f2d148dca3e.zip
LogManager überarbeitet
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/ModuleManager.cpp8
-rw-r--r--src/Common/RequestHandlers/DisconnectRequestHandler.cpp2
-rw-r--r--src/Common/RequestHandlers/SimpleRequestHandler.cpp2
-rw-r--r--src/Common/RequestHandlers/SimpleRequestHandlerGroup.cpp2
-rw-r--r--src/Common/RequestManager.cpp8
-rw-r--r--src/Common/UserCache.cpp12
-rw-r--r--src/Common/UserManager.cpp28
7 files changed, 31 insertions, 31 deletions
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<const XmlPacket> 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<const XmlPacket> 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<const XmlPacket> 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_ptr<co
if(!requestMap.isConnectionRegistered(connection)) {
// TODO: Error
- application->log(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_ptr<co
lock.unlock();
- application->logf(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<Reque
boost::unique_lock<boost::shared_mutex> 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<const std::map<unsigned long, UserInfo> > 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<const std::map<unsigned long, GroupInfo> > 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<const std::multimap<unsigned long, unsigned long> > 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<boost::shared_ptr<UserConfigBackend> >::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());
}
}