1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-11-01 06:57:04 +01:00
doorlockd-mirror/main.cpp

32 lines
529 B
C++
Raw Normal View History

2015-05-11 00:18:22 +02:00
#include <iostream>
#include <sstream>
#include <string>
#include <unistd.h>
#include "logic.h"
using namespace std;
const static Logger &l = Logger::get();
int main(void)
{
l(LogLevel::notice, "Starting doorlockd");
try {
Logic &logic = Logic::get();
logic.run();
}
catch (const char* const &ex) {
ostringstream str;
str << "FATAL ERROR: " << ex;
l(str, LogLevel::error);
}
Door::get().lock();
l(LogLevel::notice, "Doorlockd stopped");
return 0;
}