Class Logger
Inherited Members
Namespace: Unity.Simulation
Syntax
public class Logger : BaseLogger
Constructors
Logger(String, Int32, Int32, String, LoggerSuffixOption, Func<String>)
Initializes a new instance of DataCapture logger with given params.
Declaration
public Logger(string logName, int bufferSize = 8192, int maxElapsedSeconds = 5, string userPath = "", LoggerSuffixOption suffixOption = LoggerSuffixOption.SEQ_NO, Func<string> customSuffix = null)
Parameters
Type | Name | Description |
---|---|---|
String | logName | Name of the DataCapture Log file. |
Int32 | bufferSize | This corresponds to the file size (in KB). Default is set to 8192. |
Int32 | maxElapsedSeconds | |
String | userPath | Location of the log file. Default is set to Application persistent path. |
LoggerSuffixOption | suffixOption | |
Func<String> | customSuffix |
Properties
bufferSize
Declaration
public int bufferSize { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Flushall(Boolean)
Flush data in the buffer to the file system right away. Usually it waits till the size of the buffer reaches to the bufferSize set.
Declaration
public void Flushall(bool synchronous = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | synchronous |
Log(Object)
Logs the data to the file by appending it to the current buffer.
Declaration
public void Log(object parameters)
Parameters
Type | Name | Description |
---|---|---|
Object | parameters | Serializable struct containing data to be captured. |