mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-23 15:10:34 +00:00
Fix build errors
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <xrpl/basics/Expected.h>
|
||||
#include <xrpl/basics/StructuredLogging.h>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <expected>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@@ -488,7 +488,7 @@ public:
|
||||
* @param config The configuration to use
|
||||
* @return Void on success, error message on failure
|
||||
*/
|
||||
[[nodiscard]] static Expected<void, std::string>
|
||||
[[nodiscard]] static std::expected<void, std::string>
|
||||
init(LoggingConfiguration const& config);
|
||||
|
||||
/**
|
||||
@@ -569,8 +569,9 @@ private:
|
||||
* @param config The configuration to parse sinks from
|
||||
* @return A vector of sinks on success, error message on failure
|
||||
*/
|
||||
[[nodiscard]] static Expected<std::vector<std::shared_ptr<spdlog::sinks::sink>>, std::string>
|
||||
getSinks(LoggingConfiguration const& config, std::string const& format);
|
||||
[[nodiscard]] static std::
|
||||
expected<std::vector<std::shared_ptr<spdlog::sinks::sink>>, std::string>
|
||||
getSinks(LoggingConfiguration const& config, std::string const& format);
|
||||
|
||||
struct FileLoggingParams
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <xrpl/basics/Logger.h>
|
||||
|
||||
#include <xrpl/basics/Expected.h>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <spdlog/async.h>
|
||||
#include <spdlog/async_logger.h>
|
||||
@@ -19,6 +17,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <expected>
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
@@ -396,7 +395,7 @@ LogServiceState::registerLogger(std::string_view channel, std::optional<Severity
|
||||
return logger;
|
||||
}
|
||||
|
||||
Expected<std::vector<spdlog::sink_ptr>, std::string>
|
||||
std::expected<std::vector<spdlog::sink_ptr>, std::string>
|
||||
LogService::getSinks(LoggingConfiguration const& config, std::string const& format)
|
||||
{
|
||||
std::vector<spdlog::sink_ptr> allSinks = createConsoleSinks(config.enableConsole, format);
|
||||
@@ -408,7 +407,7 @@ LogService::getSinks(LoggingConfiguration const& config, std::string const& form
|
||||
{
|
||||
if (std::error_code error; !std::filesystem::create_directories(dirPath, error))
|
||||
{
|
||||
return Unexpected{fmt::format(
|
||||
return std::unexpected{fmt::format(
|
||||
"Couldn't create logs directory '{}': {}", dirPath.string(), error.message())};
|
||||
}
|
||||
}
|
||||
@@ -421,7 +420,7 @@ LogService::getSinks(LoggingConfiguration const& config, std::string const& form
|
||||
return allSinks;
|
||||
}
|
||||
|
||||
Expected<void, std::string>
|
||||
std::expected<void, std::string>
|
||||
LogService::init(LoggingConfiguration const& config)
|
||||
{
|
||||
// Format is fully determined by the logging mode.
|
||||
@@ -430,7 +429,7 @@ LogService::init(LoggingConfiguration const& config)
|
||||
auto const sinksMaybe = getSinks(config, format_);
|
||||
if (!sinksMaybe.has_value())
|
||||
{
|
||||
return Unexpected{sinksMaybe.error()};
|
||||
return std::unexpected{sinksMaybe.error()};
|
||||
}
|
||||
|
||||
logDir_ = config.directory;
|
||||
|
||||
@@ -244,15 +244,6 @@ TEST(HasToString, number_satisfies_concept)
|
||||
static_assert(detail::HasToString<Number>);
|
||||
}
|
||||
|
||||
TEST(HasToString, builtin_types_without_adl)
|
||||
{
|
||||
// Built-in types have no associated namespace for ADL, so unless
|
||||
// ToString.h is explicitly included they do not satisfy HasToString.
|
||||
// They are handled by the fmt::format fallback path instead.
|
||||
static_assert(!detail::HasToString<int>);
|
||||
static_assert(!detail::HasToString<double>);
|
||||
}
|
||||
|
||||
// -- appendJsonValue with to_string types ------------------------------------
|
||||
|
||||
TEST(AppendJsonValue, xrp_amount_quoted)
|
||||
|
||||
Reference in New Issue
Block a user