All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.agent.log.ConsoleLog Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version

package org.snapscript.agent.log;

import java.io.PrintStream;

public class ConsoleLog implements ProcessLog{
   
   private final PrintStream stream;
   
   public ConsoleLog() {
      this.stream = System.out;
   }

   @Override
   public void log(Object text) {
      stream.println(text);
   }

   @Override
   public void log(Object text, Throwable cause) {
      stream.print(text);
      
      if(cause != null) {
         stream.print(": ");
         cause.printStackTrace(stream);
      }else {
         stream.println();
      }
   }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy