Examples of LoggerOutputStream


Examples of org.apache.log.util.LoggerOutputStream

        final Hierarchy hierarchy = new Hierarchy();
        hierarchy.setDefaultLogTarget( target );

        final Logger logger = hierarchy.getLoggerFor( "myLogger" );
        final LoggerOutputStream outputStream = new LoggerOutputStream( logger, Priority.DEBUG );
        final PrintStream printer = new PrintStream( outputStream, true );

        printer.println( MSG );
        assertEquals( "LoggerOutputStream", RMSG + EOL, getResult( output ) );
View Full Code Here

Examples of org.apache.log.util.LoggerOutputStream

        final Hierarchy hierarchy = new Hierarchy();
        hierarchy.setDefaultLogTarget( target );

        final Logger logger = hierarchy.getLoggerFor( "myLogger" );
        final LoggerOutputStream outputStream = new LoggerOutputStream( logger, Priority.DEBUG );
        final PrintStream printer = new PrintStream( outputStream, true );

        printer.println( MSG );
        assertEquals( "LoggerOutputStream", RMSG + EOL, getResult( output ) );
View Full Code Here

Examples of org.apache.log.util.LoggerOutputStream

        final Hierarchy hierarchy = new Hierarchy();
        hierarchy.setDefaultLogTarget( target );

        final Logger logger = hierarchy.getLoggerFor( "myLogger" );
        final LoggerOutputStream outputStream = new LoggerOutputStream( logger, Priority.DEBUG );
        final PrintStream printer = new PrintStream( outputStream, true );

        printer.println( MSG );
        assertEquals( "LoggerOutputStream", RMSG + EOL, getResult( output ) );
View Full Code Here

Examples of org.apache.oodt.commons.io.LoggerOutputStream

      return callProgram(commandLine, stdOutStream, stdErrStream, null);
   }

   public static int callProgram(String commandLine, Logger logger, File workDir)
         throws IOException {
      LoggerOutputStream loggerInfoStream = null;
      LoggerOutputStream loggerSevereStream = null;
      try {
         return callProgram(
               commandLine,
               loggerInfoStream = new LoggerOutputStream(logger, Level.INFO),
               loggerSevereStream = new LoggerOutputStream(logger, Level.SEVERE),
               workDir);
      } catch (Exception e) {
         throw new IOException(e);
      } finally {
         try { loggerInfoStream.close(); } catch (Exception e) {}
         try { loggerSevereStream.close(); } catch (Exception e) {}
      }
   }
View Full Code Here

Examples of org.apache.oodt.commons.io.LoggerOutputStream

        try {
            progProcess = (workDir == null) ? Runtime.getRuntime().exec(
                    commandLine) : Runtime.getRuntime().exec(commandLine, null,
                    workDir);
            errorGobbler = new StreamGobbler(progProcess.getErrorStream(),
                    "ERROR", new LoggerOutputStream(logger, Level.SEVERE));
            outputGobbler = new StreamGobbler(progProcess.getInputStream(),
                    "OUTPUT", new LoggerOutputStream(logger, Level.INFO));
            errorGobbler.start();
            outputGobbler.start();
            returnVal = progProcess.waitFor();
            return returnVal;
        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.