Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9231280
Support structured logs
a1q123456 Aug 21, 2025
1774769
Support structured logs
a1q123456 Aug 21, 2025
f6d7b90
Support structured logs
a1q123456 Aug 21, 2025
af9dde4
Fix formatting
a1q123456 Aug 21, 2025
e4db80f
Fix errors
a1q123456 Aug 21, 2025
43c6e20
Fix to_string error
a1q123456 Aug 21, 2025
eda9bf1
Fix formatting
a1q123456 Aug 21, 2025
0e4f9a7
Fix errors
a1q123456 Aug 21, 2025
9edba67
Fix formatting
a1q123456 Aug 21, 2025
856b36d
Fix errors
a1q123456 Aug 21, 2025
9e09595
Fix errors
a1q123456 Aug 21, 2025
3412759
Fix errors
a1q123456 Aug 21, 2025
d68f87f
Fix errors
a1q123456 Aug 21, 2025
b3f389d
Remove unneeded file
a1q123456 Aug 21, 2025
a90bf16
Improve coverage
a1q123456 Aug 22, 2025
d36ef0c
Fix formatting
a1q123456 Aug 22, 2025
d0f0789
Update include/xrpl/basics/Log.h
a1q123456 Aug 27, 2025
ab9e656
Fix PR comments
a1q123456 Aug 27, 2025
0fe8f3f
Hardcode the log style as json
a1q123456 Aug 27, 2025
cdf1109
Performance improvement
a1q123456 Aug 28, 2025
dc221de
Fix issues
a1q123456 Aug 28, 2025
76bb517
Fix issues
a1q123456 Aug 28, 2025
a128571
Fix issues
a1q123456 Aug 28, 2025
e19d770
performance optimisation
a1q123456 Aug 29, 2025
61ff2ba
Fix issues
a1q123456 Aug 29, 2025
48cf042
Optimisation
a1q123456 Aug 29, 2025
157aa36
Fix issues
a1q123456 Aug 29, 2025
3181042
Fix issues
a1q123456 Aug 30, 2025
7500d63
Fix issues
a1q123456 Aug 30, 2025
dca000a
Optimisation
a1q123456 Aug 31, 2025
5e060a9
Fix
a1q123456 Sep 1, 2025
90f970b
Improve performance
a1q123456 Sep 1, 2025
7debf3e
Optimisation
a1q123456 Sep 1, 2025
feae1d6
Optimisation
a1q123456 Sep 1, 2025
f50f767
Fix issues
a1q123456 Sep 1, 2025
1d3d0c6
Optimise
a1q123456 Sep 2, 2025
3b2edce
Fix formatting
a1q123456 Sep 2, 2025
67aa3d5
Remove hardcoded logstyle
a1q123456 Sep 2, 2025
89ebb6b
Fix issues
a1q123456 Sep 2, 2025
addfae1
Fix formatting
a1q123456 Sep 2, 2025
bd7b098
Fix levelisation
a1q123456 Sep 2, 2025
cd8d5d9
Fix issues
a1q123456 Sep 2, 2025
458bd8a
Revert unrelated changes
a1q123456 Sep 2, 2025
c2aae2d
Optimisation
a1q123456 Sep 2, 2025
1a2b7e9
Fix issues
a1q123456 Sep 2, 2025
4f63747
Polish code
a1q123456 Sep 2, 2025
4d0c0ca
Polish code
a1q123456 Sep 2, 2025
e6c5f83
Fix formatting
a1q123456 Sep 2, 2025
28ad89c
Fix build error
a1q123456 Sep 2, 2025
3ec7596
Fix build error
a1q123456 Sep 2, 2025
fa0cff3
Fix build error
a1q123456 Sep 2, 2025
816089e
Fix error
a1q123456 Sep 2, 2025
9543ccf
Set module name in json
a1q123456 Sep 2, 2025
06c2124
Fix formatting
a1q123456 Sep 2, 2025
2f6d133
Improve test coverage
a1q123456 Sep 3, 2025
5e16b3d
Fix formatting
a1q123456 Sep 3, 2025
44aa394
Fix formatting
a1q123456 Sep 3, 2025
79e8c6a
Add additional check
a1q123456 Sep 3, 2025
0223443
Hardcode the logstyle as json
a1q123456 Sep 3, 2025
bb787e3
Optimisation
a1q123456 Sep 4, 2025
bd91ec7
Optimise
a1q123456 Sep 4, 2025
79c3a83
Fix build error
a1q123456 Sep 4, 2025
ce5a6ae
Revert unneeded changes
a1q123456 Sep 4, 2025
dcec5a0
Revert unrelated changes & performance optimisation
a1q123456 Sep 8, 2025
2c2936f
Fix issues
a1q123456 Sep 8, 2025
1dc3b25
Bugfix
a1q123456 Sep 9, 2025
d33691d
Log size optimise
a1q123456 Sep 10, 2025
f44d53b
Fix test error
a1q123456 Sep 10, 2025
893632d
Performance test
a1q123456 Sep 10, 2025
c404769
Fix test cases
a1q123456 Sep 10, 2025
a854a78
Fix test error
a1q123456 Sep 10, 2025
d2f01eb
Performance test
a1q123456 Sep 10, 2025
294dae5
Performance test
a1q123456 Sep 10, 2025
a4498f0
Performance test
a1q123456 Sep 11, 2025
211d90d
Performance test
a1q123456 Sep 11, 2025
45a4f44
Performance test
a1q123456 Sep 11, 2025
4feaa7b
WIP
a1q123456 Sep 12, 2025
acafed7
Performance test
a1q123456 Sep 12, 2025
6376f10
Fix unit tests
a1q123456 Sep 12, 2025
129166c
Fix build error
a1q123456 Sep 12, 2025
d1fe8ed
Fix error
a1q123456 Sep 12, 2025
23029ab
Optimise
a1q123456 Sep 12, 2025
56a4550
Optimise
a1q123456 Sep 14, 2025
6de7802
Remove unrelated changes
a1q123456 Sep 26, 2025
17c10de
Fix formatting
a1q123456 Sep 26, 2025
373121e
Fix levelisation
a1q123456 Sep 26, 2025
f1482d3
Fix errors
a1q123456 Sep 26, 2025
4001748
Fix formatting
a1q123456 Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions include/xrpl/basics/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <map>
#include <memory>
#include <mutex>
#include <string_view>
#include <utility>

namespace ripple {
Expand Down Expand Up @@ -130,27 +131,14 @@
Does nothing if there is no associated system file.
*/
void
write(char const* text);
write(std::string_view text);

/** write to the log file and append an end of line marker.
Does nothing if there is no associated system file.
*/
void
writeln(char const* text);
writeln(std::string_view text);

/** Write to the log file using std::string. */
/** @{ */
void
write(std::string const& str)
{
write(str.c_str());
}

void
writeln(std::string const& str)
{
writeln(str.c_str());
}
/** @} */

private:
Expand Down Expand Up @@ -186,6 +174,14 @@
beast::Journal::Sink&
operator[](std::string const& name);

template <typename AttributesFactory>
beast::Journal
journal(std::string const& name, AttributesFactory&& factory)

Check warning on line 179 in include/xrpl/basics/Log.h

View check run for this annotation

Codecov / codecov/patch

include/xrpl/basics/Log.h#L179

Added line #L179 was not covered by tests
{
return beast::Journal{
get(name), name, std::forward<AttributesFactory>(factory)};

Check warning on line 182 in include/xrpl/basics/Log.h

View check run for this annotation

Codecov / codecov/patch

include/xrpl/basics/Log.h#L182

Added line #L182 was not covered by tests
}

beast::Journal
journal(std::string const& name);

Expand Down Expand Up @@ -237,30 +233,34 @@
static LogSeverity
fromString(std::string const& s);

private:
enum {
// Maximum line length for log messages.
// If the message exceeds this length it will be truncated with elipses.
maximumMessageCharacters = 12 * 1024
};

static void
format(
std::string& output,
std::string const& message,
beast::severities::Severity severity,
std::string const& partition);

private:
enum {
// Maximum line length for log messages.
// If the message exceeds this length it will be truncated with elipses.
maximumMessageCharacters = 12 * 1024
};
};

// Wraps a Journal::Stream to skip evaluation of
// expensive argument lists if the stream is not active.
#ifndef JLOG
#define JLOG(x) \
if (!x) \
{ \
} \
else \
x
#define JLOG_JOIN_(a, b) a##b
#define JLOG_JOIN(a, b) JLOG_JOIN_(a, b)
#define JLOG_UNIQUE(base) JLOG_JOIN(base, __LINE__) // line-based unique name

#define JLOG(x) \
if (auto JLOG_UNIQUE(stream) = (x); !JLOG_UNIQUE(stream)) \
{ \
} \
else \
std::move(JLOG_UNIQUE(stream))
#endif

#ifndef CLOG
Expand Down
Loading
Loading