From 3d469e78f5cd3854d04d06bcb38eaf686055b3e2 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 7 Dec 2021 09:57:37 +1100 Subject: [PATCH] Adding failure logging to DMI info --- dependencies/dmiinfo.cpp | 5 +++++ dependencies/dmiinfo.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/dependencies/dmiinfo.cpp b/dependencies/dmiinfo.cpp index dbec8bad..6476640f 100644 --- a/dependencies/dmiinfo.cpp +++ b/dependencies/dmiinfo.cpp @@ -8,6 +8,7 @@ \*-------------------------------------------------------------------*/ #include "dmiinfo.h" +#include "LogManager.h" #ifdef WIN32 #include "wmi.h" @@ -35,6 +36,7 @@ DMIInfo::DMIInfo() if (hres) { + LOG_DEBUG("[DMI Info] Unable to read from %s", WMI); return; } @@ -62,7 +64,10 @@ DMIInfo::DMIInfo() manufacturer = ""; if ((access(SYSFSDMI "/board_vendor", R_OK)!=0) && (access(SYSFSDMI "/board_name", R_OK)!=0)) + { + LOG_DEBUG("[DMI Info] Unable to read from %s", SYSFSDMI); return; + } std::ifstream mftr(SYSFSDMI "/board_vendor", std::ifstream::in); getline(mftr, manufacturer); diff --git a/dependencies/dmiinfo.h b/dependencies/dmiinfo.h index 14195b89..60d0ac6f 100644 --- a/dependencies/dmiinfo.h +++ b/dependencies/dmiinfo.h @@ -14,6 +14,8 @@ #ifdef WIN32 #include "wmi.h" + +#define WMI "WMI" #else #include //Linux specific filesystem operation #include