<div><div dir="auto">This sounds vaguely like Log4j Audit, but with a more fluent API. Sounds neat!</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 1, 2019 at 16:19, Jordan Zimmerman <<a href="mailto:jordan@jordanzimmerman.com">jordan@jordanzimmerman.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><blockquote type="cite"><div><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!important">because then you can use that S.fluent().call().chain() code in other contexts </span></div></blockquote></div><br><div>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.</div><div><br></div><div>Statement<Schema> s = s -> <a href="http://s.name" target="_blank">s.name</a>(foo).age(bar);</div><div><br></div><div>This statement can then be re-used and even extended. There's an example here - <a href="https://github.com/Randgalt/maple/blob/master/maple-examples/src/main/java/com/myco/app/request/UpdateService.java" target="_blank">https://github.com/Randgalt/maple/blob/master/maple-examples/src/main/java/com/myco/app/request/UpdateService.java</a>. </div><div><br></div><div>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.</div><div><br></div><div>// save this meta instance somewhere</div><div>var metaIInstance = MapleSpi.instance().generate(Schema.class);</div><div><br></div><div>// convert a statement into names/values</div><div>var instance = metaInstance.newSchemaInstance();</div><div>s.handle(instance);</div><div>var namesValues = metaIInstance.toNamesValues(instance);</div><div><br></div><div>If this became a desired idiom I could make a little utility for this bit.</div><div><br></div><div><blockquote type="cite">OT3H I may be moving towards log4j2 in the next months anyway</blockquote><br></div><div>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.</div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div><div>-JZ</div></div>_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a></blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Matt Sicker <<a href="mailto:boards@gmail.com" target="_blank">boards@gmail.com</a>></div>