Ciao,
On Tue, Jan 8, 2019 at 12:53 PM Federico Fissore [email protected]
[it-torino-java-jug] <[email protected]> wrote:
> Simone Bordet [email protected] [it-torino-java-jug] ha scritto il
> 08/01/19 alle 12:17:
> > Non è vero.
> >
> > if (log.isDebugEnabled()) {
> > log.debug("a" + "{}", 1)
> > }
> >
> > Se non sei in DEBUG paghi solo l'if.
> >
> > Nel tuo caso:
> >
> > log.atDebug().log("a" + "{}", 1);
> >
> > paghi l'if (dentro atDebug()), string concatenation, boxing e varargs
> > array..
> >
>
> Giusto: uhm, non ci posso fare molto
Scusa ma non capisco.
Fare una libreria di logging che alloca di più e non salva nemmeno il
costo di if (isXXXEnabled()), che senso ha?
E nel 99% dei casi di utilizzo non usi neanche la fluency, perché i
log statements sono del tipo log("format string", params), che è lo
stesso di SLF4J debug("format string", params) - l'unica fluency che
usi è atDebug() che però introduce altri problemi (e grossi).
Non è che voglio smontarti, ma veramente non capisco l'effort, sorry.
--
Simone Bordet
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless. Victoria Livschitz