docs.unity3d.com
    Show / Hide Table of Contents

    Class LoggerConfig

    Configuration for Logger. Can be used to setup Logger and create it.

    Inheritance
    Object
    LoggerConfig
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Logging
    Syntax
    public class LoggerConfig

    Constructors

    LoggerConfig()

    Create LoggerConfig to setup a new Logger

    Declaration
    public LoggerConfig()

    Fields

    MinimumLevel

    Set minimal LogLevel that will be processed by the Logger

    Declaration
    public readonly LoggerMinimumLevelConfig MinimumLevel
    Field Value
    Type Description
    LoggerMinimumLevelConfig

    SyncMode

    Set the SyncMode that will be used by the Logger

    Declaration
    public readonly LoggerSyncModeConfig SyncMode
    Field Value
    Type Description
    LoggerSyncModeConfig

    Properties

    WriteTo

    Use this method to add new Sink

    Declaration
    public LoggerWriterConfig WriteTo { get; }
    Property Value
    Type Description
    LoggerWriterConfig

    Methods

    CaptureStacktrace(Boolean)

    Should this logger capture stacktraces

    Declaration
    public LoggerConfig CaptureStacktrace(bool capture = true)
    Parameters
    Type Name Description
    Boolean capture

    True if it should capture stacktraces

    Returns
    Type Description
    LoggerConfig

    Config to continue methods chain

    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.

    GetCaptureStacktrace()

    Returns current capture stacktrace state.

    Declaration
    public bool GetCaptureStacktrace()
    Returns
    Type Description
    Boolean

    True is current state is to capture stacktraces

    GetOutputTemplate()

    Returns current template that is used. See also OutputTemplate(FixedString512Bytes)

    Declaration
    public FixedString512Bytes GetOutputTemplate()
    Returns
    Type Description
    FixedString512Bytes

    Current template that is used

    GetRedirectUnityLogs()

    Returns current log startup state.

    Declaration
    public bool GetRedirectUnityLogs()
    Returns
    Type Description
    Boolean

    True is current state is to log startup logs

    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

    RedirectUnityLogs(Boolean)

    Should this logger redirect Unity logs

    Declaration
    public LoggerConfig RedirectUnityLogs(bool log = true)
    Parameters
    Type Name Description
    Boolean log

    True if it should redirect Unity logs

    Returns
    Type Description
    LoggerConfig

    Config to continue methods chain

    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