*/
#include <stddef.h>
#include <dpl/single_instance.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
bool SingleInstance::TryLock(const std::string &lockName)
{
- LogPedantic("Locking single instance: " << lockName);
+ WrtLogD("Locking single instance: %s", lockName.c_str());
struct flock lock;
// Was the instance successfuly locked ?
if (result == 0) {
- LogPedantic("Instance locked: " << lockName);
+ WrtLogD("Instance locked: %s", lockName.c_str());
// It is locked now
m_locked = true;
}
if (errno == EACCES || errno == EAGAIN) {
- LogPedantic("Instance is already running: " << lockName);
+ WrtLogD("Instance is already running: %s", lockName.c_str());
return false;
}
return;
}
- LogPedantic("Unlocking single instance");
+ WrtLogD("Unlocking single instance");
// Unlock file
struct flock lock;
// Done
m_locked = false;
- LogPedantic("Instance unlocked");
+ WrtLogD("Instance unlocked");
}
} // namespace DPL