Fixed the Logging system to actually be able to handle errors. Database is also fixed to use directories.

This commit is contained in:
2024-04-23 22:29:49 -07:00
parent 2734cc00fb
commit f030ac62ae
61 changed files with 884 additions and 602 deletions

View File

@@ -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;
}