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

@@ -112,7 +112,7 @@ namespace ehs
server = xcb_connect(nullptr, nullptr);
if (xcb_connection_has_error(server))
{
EHS_LOG_INT("Error", 0, "Failed to connect to display server.");
EHS_LOG_INT(LogType::ERR, 0, "Failed to connect to display server.");
return;
}
@@ -151,7 +151,7 @@ namespace ehs
{
xcb_disconnect(server);
EHS_LOG_INT("Warning", 1, "Failed to query for XCB XInput extension.");
EHS_LOG_INT(LogType::WARN, 1, "Failed to query for XCB XInput extension.");
return;
}
@@ -159,7 +159,7 @@ namespace ehs
{
xcb_disconnect(server);
EHS_LOG_INT("Warning", 2, "XCB XInput extension is not available.");
EHS_LOG_INT(LogType::WARN, 2, "XCB XInput extension is not available.");
return;
}
@@ -459,7 +459,7 @@ namespace ehs
if (!reply || reply->status != XCB_GRAB_STATUS_SUCCESS)
{
free(reply);
EHS_LOG_INT("Error", 0, "Failed to constrain cursor.");
EHS_LOG_INT(LogType::ERR, 0, "Failed to constrain cursor.");
return;
}
@@ -522,7 +522,7 @@ namespace ehs
xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply(server, geom_cookie, nullptr);
if (!geom)
{
EHS_LOG_INT("Error", 0, "Failed to retrieve window position.");
EHS_LOG_INT(LogType::ERR, 0, "Failed to retrieve window position.");
return result;
}
@@ -548,7 +548,7 @@ namespace ehs
xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply(server, geom_cookie, nullptr);
if (!geom)
{
EHS_LOG_INT("Error", 0, "Failed to retrieve window scale.");
EHS_LOG_INT(LogType::ERR, 0, "Failed to retrieve window scale.");
return result;
}
@@ -569,7 +569,7 @@ namespace ehs
if (clipboard_atom == XCB_ATOM_NONE || utf8_string_atom == XCB_ATOM_NONE || property_atom == XCB_ATOM_NONE)
{
EHS_LOG_INT("Error", 1, "Failed to retrieve atoms.");
EHS_LOG_INT(LogType::ERR, 1, "Failed to retrieve atoms.");
return result;
}
@@ -604,7 +604,7 @@ namespace ehs
const xcb_atom_t clipboard_atom = RetrieveAtom(false, "CLIPBOARD");
if (clipboard_atom == XCB_ATOM_NONE)
{
EHS_LOG_INT("Error", 0, "Failed to retrieve atom.");
EHS_LOG_INT(LogType::ERR, 0, "Failed to retrieve atom.");
return;
}
@@ -683,7 +683,7 @@ namespace ehs
if (!device_reply)
{
EHS_LOG_INT("Error", 0, "Failed to query primary devices.");
EHS_LOG_INT(LogType::ERR, 0, "Failed to query primary devices.");
return;
}
@@ -715,7 +715,7 @@ namespace ehs
if (!device_reply)
{
EHS_LOG_INT("Error", 0, "Failed to query device name from the id, \"" + Str_8::FromNum(id) + "\".");
EHS_LOG_INT(LogType::ERR, 0, "Failed to query device name from the id, \"" + Str_8::FromNum(id) + "\".");
return result;
}