From 3c4b8c5937297c22c6a7becdd93b42e43f8843f8 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 05:15:53 +0000 Subject: [PATCH 1/2] fix(OSQUERY-004): 2 review findings across 2 files --- osquery/core/windows/wmi.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osquery/core/windows/wmi.cpp b/osquery/core/windows/wmi.cpp index 89c821a97d0..709615df6a7 100644 --- a/osquery/core/windows/wmi.cpp +++ b/osquery/core/windows/wmi.cpp @@ -77,13 +77,13 @@ void WmiResultItem::PrintType(const std::string& name) const { VARIANT value; HRESULT hr = result_->Get(property_name.c_str(), 0, &value, nullptr, nullptr); if (hr != S_OK) { - std::cerr << "Failed: " << name << "\n"; + LOG(ERROR) << "Failed: " << name; } else { - std::cout << "Name=" << name << ", Type=" << value.vt << "\n"; + VLOG(1) << "Name=" << name << ", Type=" << value.vt; if (value.vt == VT_I4) { - std::cout << " Value=" << value.lVal << "\n"; + VLOG(1) << " Value=" << value.lVal; } else if (value.vt == VT_BSTR) { - std::wcout << " Value=" << value.bstrVal << "\n"; + VLOG(1) << " Value=" << wstringToString(value.bstrVal); } } VariantClear(&value); @@ -598,3 +598,4 @@ Status WmiRequest::ExecMethod(const WmiResultItem& object, } } // namespace osquery + From b40404a8b98c9d8f5225ceabbd36af5540f68a13 Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 05:15:54 +0000 Subject: [PATCH 2/2] fix(OSQUERY-004): 2 review findings across 2 files --- plugins/logger/filesystem_logger.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/logger/filesystem_logger.cpp b/plugins/logger/filesystem_logger.cpp index f6004f0b6f7..16555844cd3 100644 --- a/plugins/logger/filesystem_logger.cpp +++ b/plugins/logger/filesystem_logger.cpp @@ -33,7 +33,7 @@ bool validateLoggerMode(const char* flagname, const std::string& value) { // Account for leading 0, special bit, and normal permissions if (value.size() > 5) { osquery::systemLog(kLoggerModeInvalidValueError); - std::cerr << kLoggerModeInvalidValueError << std::endl; + LOG(ERROR) << kLoggerModeInvalidValueError; return false; } @@ -42,7 +42,7 @@ bool validateLoggerMode(const char* flagname, const std::string& value) { if (logger_mode_octal_exp.isError()) { osquery::systemLog(kLoggerModeConversionFailureError); - std::cerr << kLoggerModeConversionFailureError << std::endl; + LOG(ERROR) << kLoggerModeConversionFailureError; return false; } @@ -51,7 +51,7 @@ bool validateLoggerMode(const char* flagname, const std::string& value) { if (logger_mode_octal <= 0 || logger_mode_octal > 07777) { osquery::systemLog(kLoggerModeInvalidValueError); - std::cerr << kLoggerModeInvalidValueError << std::endl; + LOG(ERROR) << kLoggerModeInvalidValueError; return false; } @@ -320,3 +320,4 @@ void FilesystemLoggerPlugin::init(const std::string& name, FLAGS_stderrthreshold = stderr_threshold; } } // namespace osquery +