/*******************************************************************************
 * Copyright (c) 2010, 2013 Sonatype, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Stuart McCulloch (Sonatype, Inc.) - initial API and implementation
 *******************************************************************************/
package org.eclipse.sisu.util;

import java.rmi.UnexpectedException;

import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Module;

public class LoggingExample
{
    static class BadValue
    {
        @Override
        public String toString()
        {
            throw new RuntimeException( "sigh" );
        }
    }

    public LoggingExample()
    {
        Logs.trace( "", null, null );
        Logs.trace( "", "a", "b" );
        Logs.trace( "{", null, null );
        Logs.trace( "}", "a", "b" );
        Logs.trace( "}{", null, null );
        Logs.trace( "{}", "a", "b" );
        Logs.trace( "}{}", null, null );
        Logs.trace( "{{}", "a", "b" );
        Logs.trace( "{}{", null, null );
        Logs.trace( "{}}", "a", "b" );
        Logs.trace( "{{}}", null, null );
        Logs.trace( "}{}{", "a", "b" );
        Logs.trace( "{}{}", null, null );
        Logs.trace( "{}{}", "a", "b" );
        Logs.trace( "{{}}{{}}", null, null );
        Logs.trace( "{}-{}", "a", "b" );

        Logs.trace( "{} {}", new BadValue(), new BadValue() );

        Logs.trace( "Error: {} cause: {}", "oops", new UnexpectedException( "doh!" ) );

        Logs.warn( "", null, null );
        Logs.warn( "", "a", "b" );
        Logs.warn( "{", null, null );
        Logs.warn( "}", "a", "b" );
        Logs.warn( "}{", null, null );
        Logs.warn( "{}", "a", "b" );
        Logs.warn( "}{}", null, null );
        Logs.warn( "{{}", "a", "b" );
        Logs.warn( "{}{", null, null );
        Logs.warn( "{}}", "a", "b" );
        Logs.warn( "{{}}", null, null );
        Logs.warn( "}{}{", "a", "b" );
        Logs.warn( "{}{}", null, null );
        Logs.warn( "{}{}", "a", "b" );
        Logs.warn( "{{}}{{}}", null, null );
        Logs.warn( "{}-{}", "a", "b" );

        Logs.warn( "{} {}", new BadValue(), new BadValue() );

        Logs.warn( "Error: {} cause: {}", "oops", new UnexpectedException( "doh!" ) );

        final Module module = new AbstractModule()
        {
            @Override
            protected void configure()
            {
                bind( Object.class ).to( BadValue.class );
            }
        };

        Logs.trace( Logs.toString( module ), null, null );

        Logs.trace( Logs.toString( Guice.createInjector( module ) ), null, null );
    }
}

@@ -574,46 +574,8 @@
 l;%0A%0A
-import java.rmi.UnexpectedException;%0A%0A
 impo
@@ -1656,34 +1656,24 @@
 %22oops%22, new 
-Unexpected
 Exception( %22
@@ -2429,18 +2429,8 @@
 new 
-Unexpected
 Exce

Remove spurious import