1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-09-30 09:43:31 +02:00
doorlockd-mirror/main.cpp

31 lines
528 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;
}