Struct LogController.SinkStruct
Burst-friendly way to represent a sink
Inherited Members
Namespace: Unity.Logging
Syntax
public struct SinkStruct : IDisposable
Fields
CaptureStackTracesBytes
If non-zero - it captures stacktraces
Declaration
public int CaptureStackTracesBytes
Field Value
| Type | Description |
|---|---|
| Int32 |
Formatter
Formatter that is used with this sink
Declaration
public FormatterStruct Formatter
Field Value
| Type | Description |
|---|---|
| FormatterStruct |
LastTimestamp
Last timestamp that this sink processed. Sink will ignore all timestamps less/equal that this
Declaration
public long LastTimestamp
Field Value
| Type | Description |
|---|---|
| Int64 |
MinimalLevel
Minimal level that this sink is interested in
Declaration
public LogLevel MinimalLevel
Field Value
| Type | Description |
|---|---|
| LogLevel |
OnAfterSink
Delegate called after the sink
Declaration
public OnAfterSinkDelegate OnAfterSink
Field Value
| Type | Description |
|---|---|
| OnAfterSinkDelegate |
OnBeforeSink
Delegate called before the sink
Declaration
public OnBeforeSinkDelegate OnBeforeSink
Field Value
| Type | Description |
|---|---|
| OnBeforeSinkDelegate |
OnDispose
Delegate called on dispose of this sink
Declaration
public OnDisposeDelegate OnDispose
Field Value
| Type | Description |
|---|---|
| OnDisposeDelegate |
OnLogMessageEmit
Delegate called on message emit for this sink
Declaration
public OnLogMessageEmitDelegate OnLogMessageEmit
Field Value
| Type | Description |
|---|---|
| OnLogMessageEmitDelegate |
OutputTemplate
Output template that this sink should use
Declaration
public FixedString512Bytes OutputTemplate
Field Value
| Type | Description |
|---|---|
| FixedString512Bytes |
UserData
User data
Declaration
public IntPtr UserData
Field Value
| Type | Description |
|---|---|
| IntPtr |
Properties
CaptureStackTraces
True if sink needs stacktraces
Declaration
public readonly bool CaptureStackTraces { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
IsCreated
True if the sink was created
Declaration
public readonly bool IsCreated { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
Dispose()
Dispose the sink
Declaration
public void Dispose()
Implements
GetUserData()
User's data attached
Declaration
public IntPtr GetUserData()
Returns
| Type | Description |
|---|---|
| IntPtr | User data |
IsInterestedIn(ref LogMessage)
Checks if the LogMessage's Timestamp and Level fits (see 'remarks') the sink. Updates sink's 'LastTimestamp' if method returns true.
Declaration
public bool IsInterestedIn(ref LogMessage elem)
Parameters
| Type | Name | Description |
|---|---|---|
| LogMessage | elem | Log message to check |
Returns
| Type | Description |
|---|---|
| Boolean | True if this LogMessage is going to be processed by the sink |
Remarks
To return true 'LogMessage's Timestamp should be less than sink's LastTimestamp (means newer than last processed message. And its Level should be >= than sink's MinimalLevel.
Process(ref LogMessage, ref FormatterStruct, ref UnsafeText, IntPtr, Allocator)
Processes the LogMessage.
Declaration
public void Process(ref LogMessage elem, ref FormatterStruct formatter, ref UnsafeText messageBuffer, IntPtr memManager, Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| LogMessage | elem | Log message to process |
| FormatterStruct | formatter | Formatter |
| UnsafeText | messageBuffer | Message buffer that is used as a temporary storage |
| IntPtr | memManager | Memory manager where LogMessage's data is stored |
| Allocator | allocator | Allocator to use in case of temporary allocation needed during the processing |