Struct LogController.SinkStruct
Burst-friendly way to represent a sink
Implements
Inherited Members
Namespace: Unity.Logging
Assembly: Unity.Logging.dll
Syntax
public struct LogController.SinkStruct : IDisposable
Fields
CaptureStackTracesBytes
If non-zero - it captures stacktraces
Declaration
public int CaptureStackTracesBytes
Field Value
Type | Description |
---|---|
int |
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 |
---|---|
long |
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 bool CaptureStackTraces { get; }
Property Value
Type | Description |
---|---|
bool |
IsCreated
True if the sink was created
Declaration
public bool IsCreated { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Dispose()
Dispose the sink
Declaration
public void Dispose()
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 |
---|---|
bool | 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 |