Class StdOutAppender

java.lang.Object
csw.logging.client.appenders.StdOutAppender
All Implemented Interfaces:
LogAppender

public class StdOutAppender extends Object implements LogAppender
A log appender that writes common log messages to stdout. Stdout output can be printed as oneLine or pretty. oneLine will print only the message of the log statement in single line and pretty will print all the information of log statement.

param: system typed Actor System param: stdHeaders the headers that are fixes for this service

  • Constructor Summary

    Constructors
    Constructor
    Description
    StdOutAppender(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders, scala.Function1<Object,scala.runtime.BoxedUnit> logPrinter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(play.api.libs.json.JsObject baseMsg, String category)
    Writes a log message to stdout
    apply(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders)
    A constructor for the StdOutAppender class
    boolean
     
    scala.concurrent.Future<scala.runtime.BoxedUnit>
    Called just before the logger shuts down
    boolean
     
    scala.concurrent.Future<scala.runtime.BoxedUnit>
    Closes the stdout appender

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StdOutAppender

      public StdOutAppender(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders, scala.Function1<Object,scala.runtime.BoxedUnit> logPrinter)
  • Method Details

    • apply

      public static StdOutAppender apply(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders)
      A constructor for the StdOutAppender class

      Parameters:
      system - typed Actor System
      stdHeaders - the headers that are fixes for this service
      Returns:
      the stdout appender
    • color

      public boolean color()
    • oneLine

      public boolean oneLine()
    • append

      public void append(play.api.libs.json.JsObject baseMsg, String category)
      Writes a log message to stdout

      Specified by:
      append in interface LogAppender
      Parameters:
      baseMsg - the message to be logged
      category - the kinds of log (for example, "common")
    • finish

      public scala.concurrent.Future<scala.runtime.BoxedUnit> finish()
      Called just before the logger shuts down

      Specified by:
      finish in interface LogAppender
      Returns:
      a future that is completed when finished
    • stop

      public scala.concurrent.Future<scala.runtime.BoxedUnit> stop()
      Closes the stdout appender

      Specified by:
      stop in interface LogAppender
      Returns:
      a future that is completed when the close is complete