This sounds vaguely like Log4j Audit, but with a more fluent API. Sounds neat!
On Tue, Oct 1, 2019 at 16:19, Jordan Zimmerman <jor...@jordanzimmerman.com> wrote: > because then you can use that S.fluent().call().chain() code in other > contexts > > > I see. You can actually decouple, though it might need a bit more work > depending on what you need. For example, the lambda can be defined > independently. E.g. > > Statement<Schema> s = s -> s.name(foo).age(bar); > > This statement can then be re-used and even extended. There's an example > here - > https://github.com/Randgalt/maple/blob/master/maple-examples/src/main/java/com/myco/app/request/UpdateService.java > . > > Maple has a bunch on internal utils that could be useful outside of > logging. For example, you can convert a statement lambda into a list of > Names/Values via the MapleSpi factory. E.g. > > // save this meta instance somewhere > var metaIInstance = MapleSpi.instance().generate(Schema.class); > > // convert a statement into names/values > var instance = metaInstance.newSchemaInstance(); > s.handle(instance); > var namesValues = metaIInstance.toNamesValues(instance); > > If this became a desired idiom I could make a little utility for this bit. > > OT3H I may be moving towards log4j2 in the next months anyway > > > FWIW - I wrote Maple in an implementation neutral way. It would be very > easy to add a direct Log4J2 backend for it. Just a few classes to implement. > > -JZ > _______________________________________________ > slf4j-user mailing list > slf4j-user@qos.ch > http://mailman.qos.ch/mailman/listinfo/slf4j-user -- Matt Sicker <boa...@gmail.com>
_______________________________________________ slf4j-user mailing list slf4j-user@qos.ch http://mailman.qos.ch/mailman/listinfo/slf4j-user