mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-05 08:48:13 +00:00
style: clang-tidy auto fixes (#2360)
Fixes #2359. Please review and commit clang-tidy fixes. Co-authored-by: godexsoft <385326+godexsoft@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1463b0e3e5
commit
e380214496
@@ -241,7 +241,7 @@ getMinSeverity(config::ClioConfigDefinition const& config, Severity defaultSever
|
||||
static boost::log::filter
|
||||
createLogFilter(Severity defaultSeverity, std::unordered_map<std::string, Severity> const& minSeverity)
|
||||
{
|
||||
auto logFilter = [minSeverity = std::move(minSeverity),
|
||||
auto logFilter = [minSeverity = minSeverity,
|
||||
defaultSeverity](boost::log::attribute_value_set const& attributes) -> bool {
|
||||
auto const channel = attributes[LogChannel];
|
||||
auto const severity = attributes[LogSeverity];
|
||||
@@ -260,13 +260,13 @@ LogService::init(config::ClioConfigDefinition const& config)
|
||||
{
|
||||
boost::log::add_common_attributes();
|
||||
boost::log::register_simple_formatter_factory<Severity, char>("Severity");
|
||||
std::string format = config.get<std::string>("log_format");
|
||||
std::string const format = config.get<std::string>("log_format");
|
||||
|
||||
initConsoleLogging(config.get<bool>("log_to_console"), format);
|
||||
|
||||
auto const logDir = config.maybeValue<std::string>("log_directory");
|
||||
if (logDir) {
|
||||
std::filesystem::path dirPath{logDir.value()};
|
||||
std::filesystem::path const dirPath{logDir.value()};
|
||||
if (not std::filesystem::exists(dirPath)) {
|
||||
if (std::error_code error; not std::filesystem::create_directories(dirPath, error)) {
|
||||
return std::unexpected{
|
||||
@@ -286,7 +286,7 @@ LogService::init(config::ClioConfigDefinition const& config)
|
||||
auto const minSeverity = std::move(maybeMinSeverity).value();
|
||||
|
||||
auto logFilter = createLogFilter(defaultSeverity, minSeverity);
|
||||
boost::log::core::get()->set_filter(std::move(logFilter));
|
||||
boost::log::core::get()->set_filter(logFilter);
|
||||
|
||||
LOG(LogService::info()) << "Default log level = " << defaultSeverity;
|
||||
return {};
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "util/LoggerFixtures.hpp"
|
||||
|
||||
#include "util/log/Logger.hpp"
|
||||
|
||||
#include <boost/log/core/core.hpp>
|
||||
#include <boost/log/expressions/predicates/channel_severity_filter.hpp>
|
||||
#include <boost/log/keywords/format.hpp>
|
||||
@@ -26,6 +28,9 @@
|
||||
#include <boost/log/utility/setup/console.hpp>
|
||||
#include <boost/log/utility/setup/formatter_parser.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <mutex>
|
||||
|
||||
LoggerFixture::LoggerFixture()
|
||||
{
|
||||
static std::once_flag kONCE;
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
#include <boost/asio/ip/address_v4.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/spawn.hpp>
|
||||
#include <boost/asio/steady_timer.hpp>
|
||||
|
||||
Reference in New Issue
Block a user