Package csw.logging.client.appenders
Class StdOutAppender
java.lang.Object
csw.logging.client.appenders.StdOutAppender
- All Implemented Interfaces:
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
ConstructorDescriptionStdOutAppender
(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders, scala.Function1<Object, scala.runtime.BoxedUnit> logPrinter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Writes a log message to stdoutstatic StdOutAppender
apply
(akka.actor.typed.ActorSystem<?> system, play.api.libs.json.JsObject stdHeaders) A constructor for the StdOutAppender classboolean
color()
scala.concurrent.Future<scala.runtime.BoxedUnit>
finish()
Called just before the logger shuts downboolean
oneLine()
scala.concurrent.Future<scala.runtime.BoxedUnit>
stop()
Closes the stdout appender
-
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 SystemstdHeaders
- the headers that are fixes for this service- Returns:
- the stdout appender
-
color
public boolean color() -
oneLine
public boolean oneLine() -
append
Writes a log message to stdout- Specified by:
append
in interfaceLogAppender
- Parameters:
baseMsg
- the message to be loggedcategory
- 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 interfaceLogAppender
- 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 interfaceLogAppender
- Returns:
- a future that is completed when the close is complete
-