mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Support structured logs
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
@@ -167,6 +167,8 @@ private:
|
||||
beast::severities::Severity thresh_;
|
||||
File file_;
|
||||
bool silent_ = false;
|
||||
static std::unique_ptr<beast::Journal::StructuredLogAttributes>
|
||||
globalLogAttributes_;
|
||||
|
||||
public:
|
||||
Logs(beast::severities::Severity level);
|
||||
@@ -187,7 +189,10 @@ public:
|
||||
operator[](std::string const& name);
|
||||
|
||||
beast::Journal
|
||||
journal(std::string const& name);
|
||||
journal(
|
||||
std::string const& name,
|
||||
std::unique_ptr<beast::Journal::StructuredLogAttributes> attributes =
|
||||
{});
|
||||
|
||||
beast::severities::Severity
|
||||
threshold() const;
|
||||
@@ -224,6 +229,20 @@ public:
|
||||
std::string const& partition,
|
||||
beast::severities::Severity startingLevel);
|
||||
|
||||
static void
|
||||
setGlobalAttributes(std::unique_ptr<beast::Journal::StructuredLogAttributes>
|
||||
globalLogAttributes)
|
||||
{
|
||||
if (!globalLogAttributes_)
|
||||
{
|
||||
globalLogAttributes_ = std::move(globalLogAttributes);
|
||||
}
|
||||
else
|
||||
{
|
||||
globalLogAttributes_->combine(std::move(globalLogAttributes_));
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
static LogSeverity
|
||||
fromSeverity(beast::severities::Severity level);
|
||||
|
||||
Reference in New Issue
Block a user