mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
Match how logger_min_stderr works to doc (#4978)
This commit is contained in:
parent
2f50d1a13d
commit
5314fc6034
@ -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) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user