2018-11-07 12:24:35 -08:00
|
|
|
// Copyright 2013 The Flutter Authors. All rights reserved.
|
2018-05-18 15:43:49 -07:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
#include "flutter/fml/log_settings.h"
|
|
|
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#include "flutter/fml/logging.h"
|
|
|
|
|
|
|
|
|
|
namespace fml {
|
|
|
|
|
namespace state {
|
|
|
|
|
|
|
|
|
|
// Defined in log_settings_state.cc.
|
|
|
|
|
extern LogSettings g_log_settings;
|
|
|
|
|
|
|
|
|
|
} // namespace state
|
|
|
|
|
|
|
|
|
|
void SetLogSettings(const LogSettings& settings) {
|
|
|
|
|
// Validate the new settings as we set them.
|
|
|
|
|
state::g_log_settings.min_log_level =
|
|
|
|
|
std::min(LOG_FATAL, settings.min_log_level);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LogSettings GetLogSettings() {
|
|
|
|
|
return state::g_log_settings;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int GetMinLogLevel() {
|
|
|
|
|
return std::min(state::g_log_settings.min_log_level, LOG_FATAL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace fml
|