[slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. v1.5.9.RC1-16-gcfb117d

Ralph Goers rgoers at apache.org
Sun Dec 27 02:06:19 CET 2009


Note that with the MessageLogger on my fork you can do:

String s = "Hello World";
try {
  throw new NumberFormatException("This is a test");
} catch (NumberFormatException e) {("Failed to format {}", s);
  logger.error(new ParameterizedMessage("Failed to format {}", s), e);
};

Thanks to Joern doing

  logger.error("Failed to format {}", s, e);

will also work correctly.

Ralph

On Dec 26, 2009, at 3:56 PM, added by portage for gitosis-gentoo wrote:

> 
> @@ -980,11 +1004,62 @@ logger.debug("The new entry is {}.", entry);</pre>
>       <code>ILoggerFactory</code> interface as an alternative to
>       inventing your own logging API.</p>
>     </dd>
> +    
> +    <dt><a name="paramException" href="#paramException">In the presence of an
> +    exception/throwable, is it possible to parametizere a logging
> +    statement?</a></dt>
> +
> +
> +    <dd>
> +      <p>No. The SLF4J API does not support parametization in the
> +    presence of an exception. 
> 



More information about the slf4j-dev mailing list