Package io.ryos.rhino.sdk.io
Class SimulationLogWriter
- java.lang.Object
-
- akka.actor.AbstractActor
-
- io.ryos.rhino.sdk.io.SimulationLogWriter
-
- All Implemented Interfaces:
akka.actor.Actor
,ResultWriter
,java.io.Closeable
,java.lang.AutoCloseable
public class SimulationLogWriter extends akka.actor.AbstractActor implements ResultWriter
Log writer is a result writer implementation creates simulation logs containing simulation metrics.- Author:
- Erhan Bagdemir
-
-
Constructor Summary
Constructors Constructor Description SimulationLogWriter(java.lang.String logFile, SimulationLogFormatter formatter)
Constructs a newSimulationLogFormatter
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
akka.actor.AbstractActor.Receive
createReceive()
static <T extends SimulationLogFormatter>
akka.actor.Propsprops(java.lang.String pathToLogFile, T logFormatter)
Static factory method to create a new instance ofSimulationLogFormatter
.void
write(LogEvent report)
Adds a new log event into the simulation logging source.void
write(java.lang.String report)
Adds a new log event as string into the simulation logging source.-
Methods inherited from class akka.actor.AbstractActor
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, emptyBehavior, getContext, getSelf, getSender, postRestart, postStop, preRestart, preRestart, preStart, receive, receiveBuilder, self, sender, supervisorStrategy, unhandled
-
-
-
-
Constructor Detail
-
SimulationLogWriter
public SimulationLogWriter(java.lang.String logFile, SimulationLogFormatter formatter)
Constructs a newSimulationLogFormatter
instance.- Parameters:
logFile
- Path to the log file.formatter
- Log formatter.
-
-
Method Detail
-
props
public static <T extends SimulationLogFormatter> akka.actor.Props props(java.lang.String pathToLogFile, T logFormatter)
Static factory method to create a new instance ofSimulationLogFormatter
.- Type Parameters:
T
- A type ofSimulationLogFormatter
.- Parameters:
pathToLogFile
- Path to the log file.logFormatter
- Log formatter instance.- Returns:
SimulationLogFormatter
instance.
-
write
public void write(LogEvent report)
Description copied from interface:ResultWriter
Adds a new log event into the simulation logging source.- Specified by:
write
in interfaceResultWriter
- Parameters:
report
- Log event.
-
write
public void write(java.lang.String report)
Description copied from interface:ResultWriter
Adds a new log event as string into the simulation logging source.- Specified by:
write
in interfaceResultWriter
- Parameters:
report
- Log event.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
createReceive
public akka.actor.AbstractActor.Receive createReceive()
- Specified by:
createReceive
in classakka.actor.AbstractActor
-
-