[slf4j-user] logger.info("It took {%h hours %m minutes %s seconds}.", timeTakenInMilliseconds)

Geoffrey De Smet ge0ffrey.spam at gmail.com
Sat Apr 25 18:57:41 CEST 2009


Hi,

Is it possible to do something like this?

int timeTakenInMilliseconds) = 3662000;
logger.info("It took {hh:mm:ss} seconds", timeTakenInMilliseconds);

which prints this to the log:

"It took 1 hours 1 minutes 2 seconds."

The idea is that the timeTakeInMilliseconds is only parsed if info 
logging is on.
Is String.printf syntax allowed in the format of logger.info(format, args)?

-- 
With kind regards,
Geoffrey De Smet




More information about the slf4j-user mailing list