[ 
https://issues.apache.org/jira/browse/OAK-4698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated OAK-4698:
---------------------------------
    Description: Since SLF4J automatically calls {{toString()}} on any given 
non String object through its {{MessageFormatter}} 
(http://www.slf4j.org/api/org/slf4j/helpers/MessageFormatter.html#format(java.lang.String,%20java.lang.Object))
 {{DebugTimer}} should rather deprecate {{getString()}} and instead do the same 
thing in its {{toString()}} method. That way you can use {{DebugTimer}} calls 
without being forced to put an if condition around the according log statement. 
That way the expensive call to {{getString()/toString()}} would only be issued 
from within SLF4J (and are therefore only done whenever the appropriate log 
level is enabled).  (was: Since SLF4J automatically calls {{toString()}} on any 
given non String object thorugh its {{MessageFormatter}} 
(http://www.slf4j.org/api/org/slf4j/helpers/MessageFormatter.html#format(java.lang.String,%20java.lang.Object))
 {{DebugTimer}} should rather deprecate {{getString()}} and instead do the same 
thing in its {{toString()}} method. That way you can use {{DebugTimer}} calls 
without being forced to put an if condition around the according log statement. 
That way the expensive call to getString() would only be issued from within 
SLF4J (and is therefore only done whenever the appropriate log level is 
enabled).)

> DebugTimer should implement toString()
> --------------------------------------
>
>                 Key: OAK-4698
>                 URL: https://issues.apache.org/jira/browse/OAK-4698
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: commons
>    Affects Versions: 1.5.8
>            Reporter: Konrad Windszus
>            Priority: Trivial
>
> Since SLF4J automatically calls {{toString()}} on any given non String object 
> through its {{MessageFormatter}} 
> (http://www.slf4j.org/api/org/slf4j/helpers/MessageFormatter.html#format(java.lang.String,%20java.lang.Object))
>  {{DebugTimer}} should rather deprecate {{getString()}} and instead do the 
> same thing in its {{toString()}} method. That way you can use {{DebugTimer}} 
> calls without being forced to put an if condition around the according log 
> statement. That way the expensive call to {{getString()/toString()}} would 
> only be issued from within SLF4J (and are therefore only done whenever the 
> appropriate log level is enabled).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to