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

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

package org.snapscript.studio.agent.log;

import java.io.PrintStream;

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

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy