Add Logger Class
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <syslog.h>
|
||||
#include "Util/JSON.h"
|
||||
#include "Util/Logger.h"
|
||||
#include "Functions.h"
|
||||
#include "Device.h"
|
||||
|
||||
@@ -57,7 +57,7 @@ void Device::UpdateDevicesFromInventory()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Bluetooth::Device::GetDevicesFromInventory() - Error: " << e.what() << std::endl;
|
||||
syslog(LOG_ERR, "%s", ss.str().c_str());
|
||||
Util::Logger::Log(Util::Logger::Severity::Error, ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void Device::UpdatePresentDevices()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Bluetooth::Device::UpdatePresentDevices() - Error: " << e.what() << std::endl;
|
||||
syslog(LOG_ERR, "%s", ss.str().c_str());
|
||||
Util::Logger::Log(Util::Logger::Severity::Error, ss.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void Device::SendStateChange(bool present, const std::string& macAddress)
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Bluetooth: " << sign << " " << macAddress;
|
||||
syslog(LOG_INFO, "%s", ss.str().c_str());
|
||||
Util::Logger::Log(Util::Logger::Severity::Info, ss.str());
|
||||
|
||||
std::stringstream url;
|
||||
url << m_target << "/Bluetooth/" << sign << "/" << macAddress;
|
||||
@@ -114,9 +114,6 @@ void Device::SendStateChange(bool present, const std::string& macAddress)
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Bluetooth::Device::SendStateChange() - Error: " << e.what() << std::endl;
|
||||
syslog(LOG_ERR, "%s", ss.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <syslog.h>
|
||||
#include <bluetooth/bluetooth.h>
|
||||
#include <bluetooth/hci.h>
|
||||
#include <bluetooth/l2cap.h>
|
||||
|
||||
Reference in New Issue
Block a user