Convert linux to use new logging facility

This commit is contained in:
Azamat H. Hackimov
2024-08-20 01:38:10 +03:00
parent e627dfc546
commit dc82d2314d
4 changed files with 26 additions and 24 deletions

View File

@@ -41,8 +41,8 @@
* $NoKeywords: $
*/
#include <string.h>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <sys/types.h>
#if defined(POSIX)
@@ -58,7 +58,7 @@
#include "appdatabase.h"
#include "linux/lnxdatabase.h"
#include "pserror.h"
#include "mono.h"
#include "log.h"
#include "pserror.h"
#include "registry.h"
@@ -103,7 +103,7 @@ oeLnxAppDatabase::~oeLnxAppDatabase() {
return;
}
mprintf(0, "Can't Export Database Since It's Not There!\n");
LOG_ERROR << "Can't Export Database Since It's Not There!";
}
CRegistry *oeLnxAppDatabase::GetSystemRegistry() { return database; }
@@ -118,7 +118,7 @@ bool oeLnxAppDatabase::create_record(const char *pathname) {
database->CreateKey((char *)pathname);
return true;
}
mprintf(0, "Can't CreateKey because database NULL\n");
LOG_ERROR << "Can't CreateKey because database NULL";
return false;
}
@@ -128,7 +128,7 @@ bool oeLnxAppDatabase::lookup_record(const char *pathname) {
if (database) {
return database->LookupKey((char *)pathname);
}
mprintf(0, "Can't lookup key because database NULL\n");
LOG_ERROR << "Can't lookup key because database NULL";
return false;
}
@@ -138,7 +138,7 @@ bool oeLnxAppDatabase::read(const char *label, char *entry, int *entrylen) {
ASSERT(entry);
ASSERT(entrylen);
if (!database) {
mprintf(0, "Can't read record because database NULL\n");
LOG_ERROR << "Can't read record because database NULL";
return false;
}
@@ -159,7 +159,7 @@ bool oeLnxAppDatabase::read(const char *label, void *entry, int wordsize) {
ASSERT(label);
ASSERT(entry);
if (!database) {
mprintf(0, "Can't read record because Database NULL\n");
LOG_ERROR << "Can't read record because Database NULL";
return false;
}
@@ -182,7 +182,7 @@ bool oeLnxAppDatabase::read(const char *label, void *entry, int wordsize) {
*((uint32_t *)entry) = (uint32_t)data;
break;
default:
mprintf(0, "Unable to read key %s, unsupported size", label);
LOG_ERROR.printf("Unable to read key %s, unsupported size", label);
return false;
break;
}
@@ -203,7 +203,7 @@ bool oeLnxAppDatabase::write(const char *label, const char *entry, int entrylen)
ASSERT(label);
ASSERT(entry);
if (!database) {
mprintf(0, "Can't write record because database NULL\n");
LOG_ERROR << "Can't write record because database NULL";
return false;
}
@@ -213,7 +213,7 @@ bool oeLnxAppDatabase::write(const char *label, const char *entry, int entrylen)
bool oeLnxAppDatabase::write(const char *label, int entry) {
ASSERT(label);
if (!database) {
mprintf(0, "Can't write record because database NULL\n");
LOG_ERROR << "Can't write record because database NULL";
return false;
}
return database->CreateRecord((char *)label, REGT_DWORD, &entry);