public String reformat ( final Map < String , String > context , final String message ) { final HashMap < String , String > tokens = new HashMap < String , String > ( ) ; if ( null != context ) { tokens . putAll ( context ) ; } if ( null != generator ) { tokens . putAll ( generator . getMap ( ) ) ; } else if ( null != data ) { tokens . putAll ( data ) ; } final String [ ] arr = { null != tokens . get ( "user" ) ? tokens . get ( "user" ) : "" , null != tokens . get ( "node" ) ? tokens . get ( "node" ) : "" , null != tokens . get ( "command" ) ? tokens . get ( "command" ) : "" , tokens . get ( "level" ) , message } ; synchronized ( messageFormat ) { return messageFormat . format ( arr ) ; } }
Combines the context data and the local static or dynamic context data and reformats the message