Class LoggerConfig
Configuration for Logger. Can be used to setup Logger and create it.
Inherited Members
Namespace: Unity.Logging
Syntax
public class LoggerConfig
Constructors
LoggerConfig()
Create LoggerConfig to setup a new Logger
Declaration
public LoggerConfig()
Fields
MinimumLevel
Declaration
public readonly LoggerMinimumLevelConfig MinimumLevel
Field Value
Type | Description |
---|---|
LoggerMinimumLevelConfig |
SyncMode
Declaration
public readonly LoggerSyncModeConfig SyncMode
Field Value
Type | Description |
---|---|
LoggerSyncModeConfig |
Properties
WriteTo
Use this method to add new Sink
Declaration
public LoggerWriterConfig WriteTo { get; }
Property Value
Type | Description |
---|---|
LoggerWriterConfig |
Methods
CaptureStacktrace(Boolean)
Should this logger capture stacktraces
Declaration
public LoggerConfig CaptureStacktrace(bool capture = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | capture | True if it should capture stacktraces |
Returns
Type | Description |
---|---|
LoggerConfig | Config to continue methods chain |
CreateLogger()
Call that creates Logger using default LogMemoryManagerParameters
Declaration
public Logger CreateLogger()
Returns
Type | Description |
---|---|
Logger | New Logger that is created using this configuration. |
CreateLogger(LogMemoryManagerParameters)
Call that creates Logger
Declaration
public Logger CreateLogger(LogMemoryManagerParameters logMemoryManagerParameters)
Parameters
Type | Name | Description |
---|---|---|
LogMemoryManagerParameters | logMemoryManagerParameters | LogMemoryManagerParameters to initialize LogMemoryManager with. |
Returns
Type | Description |
---|---|
Logger | New Logger that is created using this configuration. |
GetCaptureStacktrace()
Returns current capture stacktrace state.
Declaration
public bool GetCaptureStacktrace()
Returns
Type | Description |
---|---|
Boolean | True is current state is to capture stacktraces |
GetOutputTemplate()
Returns current template that is used. See also OutputTemplate(FixedString512Bytes)
Declaration
public FixedString512Bytes GetOutputTemplate()
Returns
Type | Description |
---|---|
FixedString512Bytes | Current template that is used |
GetRedirectUnityLogs()
Returns current log startup state.
Declaration
public bool GetRedirectUnityLogs()
Returns
Type | Description |
---|---|
Boolean | True is current state is to log startup logs |
OutputTemplate(FixedString512Bytes)
Template that should be used by sinks by default. All sinks without explicit OutputTemplate will use this one after this call.
Declaration
public LoggerConfig OutputTemplate(FixedString512Bytes newTemplate)
Parameters
Type | Name | Description |
---|---|---|
FixedString512Bytes | newTemplate | Template for the messages. Can use any strings and {Level}, {Timestamp}, {Message} as special holes. |
Returns
Type | Description |
---|---|
LoggerConfig | Config to continue methods chain |
RedirectUnityLogs(Boolean)
Should this logger redirect Unity logs
Declaration
public LoggerConfig RedirectUnityLogs(bool log = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | log | True if it should redirect Unity logs |
Returns
Type | Description |
---|---|
LoggerConfig | Config to continue methods chain |