logging lib

This commit is contained in:
Drath
2025-10-03 16:57:38 +02:00
parent 31f2c8bf7c
commit 7e7d8d2aa1
12 changed files with 80 additions and 48 deletions

View File

@@ -46,7 +46,7 @@ std::string pBytes(double bytes, bool isKbytes) {
ssize_t readFile2(const char* path, char* buffer, size_t maxlen) {
int fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
std::println("[readFile] Error reading {}", path);
log(LOG::ERR, "readFile2", "Error reading {}", path);
return 0;
}
ssize_t len = read(fd, buffer, maxlen - 1);