Use cpputils::logging

This commit is contained in:
Sebastian Meßmer 2015-10-17 03:30:42 +02:00
parent 2e8b17bd17
commit 62e0a177fb

View File

@ -1,8 +1,9 @@
#include "PeriodicTask.h"
#include <messmer/cpp-utils/logging/logging.h>
using std::function;
using std::cerr;
using std::endl;
using namespace cpputils::logging;
namespace blockstore {
namespace caching {
@ -18,11 +19,9 @@ PeriodicTask::PeriodicTask(function<void ()> task, double intervalSec) : _thread
} catch (const boost::thread_interrupted &e) {
//Do nothing, exit thread.
} catch (const std::exception &e) {
//TODO Think about logging
cerr << "PeriodicTask crashed: " << e.what() << endl;
LOG(ERROR) << "PeriodicTask crashed: " << e.what();
} catch (...) {
//TODO Think about logging
cerr << "PeriodicTask crashed" << endl;
LOG(ERROR) << "PeriodicTask crashed";
}
});
}