Class LoggerConfig
Configuration for Logger. Can be used to setup Logger and create it.
Namespace: Unity.Logging
Syntax
public class LoggerConfig : object
Constructors
LoggerConfig()
Create LoggerConfig to setup a new Logger
Declaration
public LoggerConfig()
Fields
MinimumLevel
Declaration
public readonly LoggerMinimumLevelConfig MinimumLevel
Field Value
Type | Description |
---|---|
LoggerMinimumLevelConfig |
Properties
WriteTo
Use this method to add new Sink
Declaration
public LoggerWriterConfig WriteTo { get; }
Property Value
Type | Description |
---|---|
LoggerWriterConfig |
Methods
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. |
GetOutputTemplate()
Returns current template that is used. See also OutputTemplate(FixedString512Bytes)
Declaration
public FixedString512Bytes GetOutputTemplate()
Returns
Type | Description |
---|---|
FixedString512Bytes | Current template that is used |
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 |