docs.unity3d.com
    Show / Hide Table of Contents

    Class SinkConfiguration

    SinkConfiguration stores all the data needed for Sink to work and what is most important - knows how to create and initialize the sink.

    Inheritance
    Object
    SinkConfiguration
    FileSinkSystem.Configuration
    StdOutSinkSystem.Configuration
    StringSink.Configuration
    UnityDebugLogSink.Configuration
    UnityEditorConsoleSink.Configuration
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Logging.Sinks
    Syntax
    public abstract class SinkConfiguration

    Constructors

    SinkConfiguration(LoggerWriterConfig, FormatterStruct, Nullable<Boolean>, Nullable<LogLevel>, Nullable<FixedString512Bytes>)

    Base sink configuration constructor.

    Declaration
    protected SinkConfiguration(LoggerWriterConfig writeTo, FormatterStruct formatter, bool? captureStackTraceOverride = null, LogLevel? minLevelOverride = null, FixedString512Bytes? outputTemplateOverride = null)
    Parameters
    Type Name Description
    LoggerWriterConfig writeTo

    Logger config

    FormatterStruct formatter

    Formatter that should be used by this sink. Text is default

    Nullable<Boolean> captureStackTraceOverride

    True if stack traces should be captured. Null if common setting should be used

    Nullable<LogLevel> minLevelOverride

    Minimal level of logs for this particular sink. Null if common level should be used

    Nullable<FixedString512Bytes> outputTemplateOverride

    Output message template for this particular sink. Null if common template should be used

    Fields

    CaptureStackTraces

    True if this logger needs stack traces.

    Declaration
    public bool CaptureStackTraces
    Field Value
    Type Description
    Boolean

    LogFormatter

    Formatter that controls how to represent the log message: plain text, json, etc..

    Declaration
    public FormatterStruct LogFormatter
    Field Value
    Type Description
    FormatterStruct

    MinLevel

    Minimal level that sink will log.

    Declaration
    public LogLevel MinLevel
    Field Value
    Type Description
    LogLevel

    OutputTemplate

    Output template for the message. Ignored in structured logging case.

    Declaration
    public FixedString512Bytes OutputTemplate
    Field Value
    Type Description
    FixedString512Bytes

    Methods

    CreateAndInitializeSinkInstance<T>(Logger, SinkConfiguration)

    Standard way of creation and init the sink

    Declaration
    public static T CreateAndInitializeSinkInstance<T>(Logger logger, SinkConfiguration configuration)
        where T : SinkSystemBase, new()
    Parameters
    Type Name Description
    Logger logger

    Parent Logger

    SinkConfiguration configuration

    Configuration that stores all the data needed for the init

    Returns
    Type Description
    T

    Specific SinkSystemBase sink instance, already Initialized

    Type Parameters
    Name Description
    T

    SinkSystemBase

    CreateSinkInstance(Logger)

    Function that creates specific SinkSystem using this configuration.

    Declaration
    public abstract SinkSystemBase CreateSinkInstance(Logger logger)
    Parameters
    Type Name Description
    Logger logger

    Parent Logger

    Returns
    Type Description
    SinkSystemBase

    Specific SinkSystem that is going to be added to the Logger

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023