public static CliDiagnosticListener initializeLogs(final String[] args,final PrintStream err,final LogStream initLog){
  if (initLog != null) {
    Diagnostic.setLogStream(initLog);
    Diagnostic.logEnvironment();
  }
 else {
    Diagnostic.setLogStream();
  }
  Diagnostic.userLog("Command line arguments:" + Arrays.toString(args));
  final CliDiagnosticListener listener=new CliDiagnosticListener(err);
  Diagnostic.addListener(listener);
  return listener;
}

public static CliDiagnosticListener initializeLogs ( final String [ ] args , final PrintStream err , final LogStream initLog ) { if ( initLog != null ) { Diagnostic . setLogStream ( initLog ) ; Diagnostic . logEnvironment ( ) ; } else { Diagnostic . setLogStream ( ) ; } Diagnostic . userLog ( "Command line arguments:" + Arrays . toString ( args ) ) ; final CliDiagnosticListener listener = new CliDiagnosticListener ( err ) ; Diagnostic . addListener ( listener ) ; return listener ; }
do common tasks for initializing logs .
