Logback에서 MessageFormat을 사용할 수 있습니까? Out of curiosity -- why don't logging APIs implement printf()-like logging methods?LogBack에서 MessageFormat을 사용하십시오.
SLF4J는 자바 플랫폼의에서 을 다른 자신의 메시지 포맷 구현을 사용합니다 :
나는 그것의 속도로 여기 말했다 있기 때문에, ter에게 SLF4J의 MessageFormat의 를 사용하는 것을 보았다. 이것은 SLF4J의 구현이 약 10 배 더 빠르지 만 비용이 비표준이고 덜 유연한 인 경우에 정당화됩니다.Object[] arguments = { new Integer(7), new Date(System.currentTimeMillis()), "a disturbance in the Force" }; String result = MessageFormat.format( "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.", arguments); output: At 12:30 PM on Jul 3, 2053, there was a disturbance in the Force on planet 7.
사람 :
ideia 그런 MessageFormat의 전체 스택 기능을 사용할 수 있나요?