src/main/java/pityoulish/jrmi/server/Catalog.java
public final static <X extends Throwable> X log(Logger l, String ctx, X x)
   {
     Log.log(l, ctx, x);
     System.out.println(x.toString());
     return x;
   }
/**
    * Logs an exception.
    * A summary of the exception is also printed to the console.
    * The exception is returned, so that the caller can throw it like:
    * <pre>
    *     throw Catalog.log(logger, "context", Catalog.asApiX(...));
    * </pre>
    *
    * <b>Note:</b> This method has nothing to do with the catalog.
    * But because the catalog already has methods to create APIExceptions,
    * it makes sense to put the helper for logging them here as well.
    * There is no implicit logging of the exceptions when they are created.
    * Logging should be done at the point where the exception is thrown.
    *
    * @param l     where to log
    * @param ctx   context information for the exception
    * @param x     the exception to log
    * @param <X>   the type of exception to log
    *
    * @return the <code>x</code> argument
    */
Logs an exception.
A summary of the exception is also printed to the console.
The exception is returned, so that the caller can throw it like:

throw Catalog.log(logger, "context", Catalog.asApiX(...));


Note: This method has nothing to do with the catalog.
But because the catalog already has methods to create APIExceptions,
it makes sense to put the helper for logging them here as well.
There is no implicit logging of the exceptions when they are created.
Logging should be done at the point where the exception is thrown.

@param l     where to log
@param ctx   context information for the exception
@param x     the exception to log
@param    the type of exception to log

@return the x argument
Logs an exception . A summary of the exception is also printed to the console . The exception is returned so that the caller can throw it like : throw Catalog . log ( logger " context " Catalog . asApiX ( ... )) ; Note : This method has nothing to do with the catalog . But because the catalog already has methods to create APIExceptions it makes sense to put the helper for logging them here as well . There is no implicit logging of the exceptions when they are created . Logging should be done at the point where the exception is thrown . @param l where to log @param ctx context information for the exception @param x the exception to log @param the type of exception to log @return the x argument
public final static <X extends Throwable> X log(Logger l, String ctx, X x)
   {
     Log.log(l, ctx, x);
     System.out.println(x.toString());
     return x;
   }
public final static < X extends Throwable > X log ( Logger l , String ctx , X x ) { Log . log ( l , ctx , x ) ; System . out . println ( x . toString ( ) ) ; return x ; }
Logs an exception.
Logs an exception .