Match how logger_min_stderr works to doc (#4978)

This commit is contained in:
Giorgi Guliashvili 2018-08-20 15:11:29 +01:00 committed by GitHub
parent 2f50d1a13d
commit 5314fc6034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View File

@ -306,12 +306,7 @@ void setVerboseLevel() {
FLAGS_minloglevel = default_level;
}
if (!Flag::isDefault("logger_min_stderr")) {
auto i = Flag::getInt32Value("logger_min_stderr");
FLAGS_stderrthreshold = static_cast<decltype(FLAGS_logger_min_stderr)>(i);
} else if (Flag::isDefault("stderrthreshold")) {
FLAGS_stderrthreshold = default_level;
}
FLAGS_stderrthreshold = Flag::getInt32Value("logger_min_stderr");
}
if (!FLAGS_logger_stderr) {

View File

@ -18,11 +18,11 @@
#include <osquery/registry_factory.h>
DECLARE_int32(minloglevel);
DECLARE_int32(stderrthreshold);
namespace osquery {
DECLARE_int32(logger_min_status);
DECLARE_int32(logger_min_stderr);
DECLARE_bool(logger_secondary_status_only);
DECLARE_bool(logger_status_sync);
DECLARE_bool(logger_event_type);
@ -211,13 +211,13 @@ TEST_F(LoggerTests, test_logger_status_level) {
EXPECT_EQ(2U, LoggerTests::statuses_logged);
FLAGS_minloglevel = minloglevel;
auto stderrthreshold = FLAGS_stderrthreshold;
FLAGS_stderrthreshold = 2;
const auto logger_min_stderr = FLAGS_logger_min_stderr;
FLAGS_logger_min_stderr = 2;
setVerboseLevel();
LOG(WARNING) << "Logger test is generating a warning status";
EXPECT_EQ(3U, LoggerTests::statuses_logged);
FLAGS_stderrthreshold = stderrthreshold;
FLAGS_logger_min_stderr = logger_min_stderr;
auto logger_min_status = FLAGS_logger_min_status;
FLAGS_logger_min_status = 1;