void dmlite::vfsThrowHelper(const std::string &classname, const std::string& func, int code, const std::string& msg) throw (DmException) {
- throw DmException(code, classname + "::" + func + "(): " + msg);
+ std::string text;
+
+ text = classname + "::" + func + "(): " + msg;
+#ifdef DEBUG
+ syslog(LOG_DEBUG, "%s", text.c_str());
+#endif
+ throw DmException(code, text);
}
struct hostent* hent = gethostbyname(hname.nodename);
this->hostName_ = hent->h_name;
+#ifdef DEBUG
+ openlog("dmlite-vfs-plugin", LOG_PID, LOG_USER);
+#endif
}
Catalog* VfsFactory::createCatalog(PluginManager*) throw (DmException)
{
+ syslog(LOG_DEBUG, "%s", __func__);
return new VfsCatalog(this->hostName_, this->allow_, this->deny_);
}
PoolManager* VfsFactory::createPoolManager(PluginManager*) throw (DmException)
{
+ syslog(LOG_DEBUG, "%s", __func__);
return new VfsPoolManager(this->hostName_,
this->tokenPasswd_, this->tokenUseIp_,
this->tokenLife_);
PoolDriver* VfsFactory::createPoolDriver() throw (DmException)
{
+ syslog(LOG_DEBUG, "%s", __func__);
return new VfsPoolDriver(this->hostName_,
this->tokenPasswd_, this->tokenUseIp_,
this->tokenLife_);
IODriver* VfsFactory::createIODriver(PluginManager*) throw (DmException)
{
+ syslog(LOG_DEBUG, "%s", __func__);
return new VfsIODriver(this->tokenPasswd_, this->tokenUseIp_);
}
Authn* VfsFactory::createAuthn(PluginManager*) throw (DmException)
{
+ syslog(LOG_DEBUG, "%s", __func__);
return new VfsAuthn();
}
#include <dmlite/cpp/io.h>
#include <dmlite/cpp/poolmanager.h>
+#ifdef DEBUG
+#include <syslog.h>
+#else
+#define syslog
+#define LOG_DEBUG 0
+#endif
+
#ifdef __GNUC__
#define vfsThrowErrno(MSG...) dmlite::vfsThrowHelper(getImplId(), __func__, DMLITE_SYSERR(errno) , ##MSG)