Metalog. A low impact and highly performant structured meta logging library for Java.
// light
publish(() -> "Hello World");
// heavy
publish( () -> {
StringBuilder builder = new StringBuilder();
builder.append(e.getMessage());
builder.append(System.lineSeparator());
builder.append(someCostlyOperation());
return builder;
},
b -> b // Meta builder callback
.thrown(e) // retain exception
.thread() // retain current thread information
.time()); // retain current time
// hidden heavy
publish(this::someMethodToProduceTheMessage);