summaryrefslogtreecommitdiff
path: root/src/envwindows.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-07-19 02:47:13 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-07-22 07:36:38 -0400
commite071dfdfaa369a475a2d93df623c1696feee56ba (patch)
tree4e3f1714558f6ac46f010b1cae561a96c1195c03 /src/envwindows.cpp
parentaae6d6a5aa8d6b101fcc38388222a8a6e7ee2ec6 (diff)
changed qCritical() to log::error()
removed now unused vlog()
Diffstat (limited to 'src/envwindows.cpp')
-rw-r--r--src/envwindows.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/envwindows.cpp b/src/envwindows.cpp
index 4fbd788a..8a98036a 100644
--- a/src/envwindows.cpp
+++ b/src/envwindows.cpp
@@ -1,6 +1,7 @@
#include "envwindows.h"
#include "env.h"
#include <utility.h>
+#include <log.h>
namespace env
{
@@ -13,7 +14,7 @@ WindowsInfo::WindowsInfo()
LibraryPtr ntdll(LoadLibraryW(L"ntdll.dll"));
if (!ntdll) {
- qCritical() << "failed to load ntdll.dll while getting version";
+ log::error("failed to load ntdll.dll while getting version");
return;
} else {
m_reported = getReportedVersion(ntdll.get());
@@ -122,7 +123,7 @@ WindowsInfo::Version WindowsInfo::getReportedVersion(HINSTANCE ntdll) const
GetProcAddress(ntdll, "RtlGetVersion"));
if (!RtlGetVersion) {
- qCritical() << "RtlGetVersion() not found in ntdll.dll";
+ log::error("RtlGetVersion() not found in ntdll.dll");
return {};
}
@@ -149,7 +150,7 @@ WindowsInfo::Version WindowsInfo::getRealVersion(HINSTANCE ntdll) const
GetProcAddress(ntdll, "RtlGetNtVersionNumbers"));
if (!RtlGetNtVersionNumbers) {
- qCritical() << "RtlGetNtVersionNumbers not found in ntdll.dll";
+ log::error("RtlGetNtVersionNumbers not found in ntdll.dll");
return {};
}
@@ -207,9 +208,9 @@ std::optional<bool> WindowsInfo::getElevated() const
if (!OpenProcessToken(GetCurrentProcess( ), TOKEN_QUERY, &rawToken)) {
const auto e = GetLastError();
- qCritical()
- << "while trying to check if process is elevated, "
- << "OpenProcessToken() failed: " << formatSystemMessageQ(e);
+ log::error(
+ "while trying to check if process is elevated, "
+ "OpenProcessToken() failed: {}", formatSystemMessageQ(e));
return {};
}
@@ -223,9 +224,9 @@ std::optional<bool> WindowsInfo::getElevated() const
if (!GetTokenInformation(token.get(), TokenElevation, &e, sizeof(e), &size)) {
const auto e = GetLastError();
- qCritical()
- << "while trying to check if process is elevated, "
- << "GetTokenInformation() failed: " << formatSystemMessageQ(e);
+ log::error(
+ "while trying to check if process is elevated, "
+ "GetTokenInformation() failed: {}", formatSystemMessageQ(e));
return {};
}