Fixed the Logging system to actually be able to handle errors. Database is also fixed to use directories.
This commit is contained in:
@@ -65,32 +65,32 @@ namespace ehs
|
||||
{
|
||||
if (!IsValid())
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Cannot initialize with an invalid object.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Cannot initialize with an invalid object.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsInitialized())
|
||||
{
|
||||
EHS_LOG_INT("Warning", 1, "Object is already initialized.");
|
||||
EHS_LOG_INT(LogType::WARN, 1, "Object is already initialized.");
|
||||
return;
|
||||
}
|
||||
|
||||
hdl = open("/dev/bus/usb/" + Str_8::FromNum(GetBus()) + "/" + Str_8::FromNum(GetAddress()), O_RDWR);
|
||||
if (hdl == -1)
|
||||
EHS_LOG_INT("Error", 2, "Failed to connect to USB device.");
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Failed to connect to USB device.");
|
||||
}
|
||||
|
||||
void Usb::Release()
|
||||
{
|
||||
if (!IsValid())
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Cannot release with an invalid object.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Cannot release with an invalid object.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsInitialized())
|
||||
{
|
||||
EHS_LOG_INT("Warning", 1, "Object is already released.");
|
||||
EHS_LOG_INT(LogType::WARN, 1, "Object is already released.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user