Use cpputils::logging
This commit is contained in:
parent
2e8b17bd17
commit
62e0a177fb
@ -1,8 +1,9 @@
|
|||||||
#include "PeriodicTask.h"
|
#include "PeriodicTask.h"
|
||||||
|
#include <messmer/cpp-utils/logging/logging.h>
|
||||||
|
|
||||||
using std::function;
|
using std::function;
|
||||||
using std::cerr;
|
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
using namespace cpputils::logging;
|
||||||
|
|
||||||
namespace blockstore {
|
namespace blockstore {
|
||||||
namespace caching {
|
namespace caching {
|
||||||
@ -18,11 +19,9 @@ PeriodicTask::PeriodicTask(function<void ()> task, double intervalSec) : _thread
|
|||||||
} catch (const boost::thread_interrupted &e) {
|
} catch (const boost::thread_interrupted &e) {
|
||||||
//Do nothing, exit thread.
|
//Do nothing, exit thread.
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
//TODO Think about logging
|
LOG(ERROR) << "PeriodicTask crashed: " << e.what();
|
||||||
cerr << "PeriodicTask crashed: " << e.what() << endl;
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
//TODO Think about logging
|
LOG(ERROR) << "PeriodicTask crashed";
|
||||||
cerr << "PeriodicTask crashed" << endl;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user