Class SinkSystemBase
Base Sink class that implements SinkSystemBase
Inherited Members
Namespace: Unity.Logging.Sinks
Syntax
[BurstCompile]
public abstract class SinkSystemBase : IDisposable
Fields
Handle
Logger's handle that owns the sink
Declaration
protected LoggerHandle Handle
Field Value
| Type | Description |
|---|---|
| LoggerHandle |
IsInitialized
True if Sink was initialized and can run 'Update'
Declaration
protected bool IsInitialized
Field Value
| Type | Description |
|---|---|
| Boolean |
SinkId
Id of this sink in the logger
Declaration
public int SinkId
Field Value
| Type | Description |
|---|---|
| Int32 |
SystemConfig
SinkConfiguration that was used to setup the sink
Declaration
protected SinkConfiguration SystemConfig
Field Value
| Type | Description |
|---|---|
| SinkConfiguration |
Methods
Dispose()
See IDisposable. Used to dispose all the resources associated with this sink.
Declaration
public virtual void Dispose()
Implements
GetMinimalLogLevel()
Get minimal log level that this Sink is interested in
Declaration
public LogLevel GetMinimalLogLevel()
Returns
| Type | Description |
|---|---|
| LogLevel | Minimal log level that this Sink is interested in |
Initialize(Logger, SinkConfiguration)
Method to initialize the sink
Declaration
public virtual void Initialize(Logger logger, SinkConfiguration systemConfig)
Parameters
| Type | Name | Description |
|---|---|---|
| Logger | logger | Parent Logger |
| SinkConfiguration | systemConfig | SinkConfiguration-inherited class that contains specialized configurations for the sink |
Exceptions
| Type | Condition |
|---|---|
| Exception | If logger.Handle.IsValid is false |
NeedsStackTrace()
Returns true if this sink is interested in the stack traces.
Declaration
public bool NeedsStackTrace()
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if this sink is interested in the stack traces. |
OnSinkFatalError(FixedString512Bytes)
If any error happens - this method will self-log it and set IsInitialized to false, disabling the sink
Declaration
protected void OnSinkFatalError(FixedString512Bytes reason)
Parameters
| Type | Name | Description |
|---|---|---|
| FixedString512Bytes | reason | User facing error message |
ScheduleUpdate(LogControllerScopedLock, JobHandle)
Schedule update for this sink. Usually schedules an internal SinkJob.
Declaration
public virtual JobHandle ScheduleUpdate(LogControllerScopedLock lock, JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| Unity.Logging.Internal.LogControllerScopedLock | lock | Lock to access to LogController |
| JobHandle | dependency | Input dependency that should be done before this job |
Returns
| Type | Description |
|---|---|
| JobHandle | Job handle for the SinkJob |
SetMinimalLogLevel(LogLevel)
Set minimal log level that this Sink is interested in
Declaration
public void SetMinimalLogLevel(LogLevel minimalLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| LogLevel | minimalLevel | LogLevel to set as a minimal level |
ToSinkStruct()
SinkStruct that is burst-compatible struct that represents this sink
Declaration
public virtual LogController.SinkStruct ToSinkStruct()
Returns
| Type | Description |
|---|---|
| LogController.SinkStruct | SinkStruct struct of this sink |