{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class Logger | Unity Logging | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Logger

    Main class of Logging library. Contains Sinks, unique identifier LoggerHandle

    Inheritance
    object
    Logger
    Implements
    IDisposable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Logging
    Assembly: solution.dll
    Syntax
    public class Logger : IDisposable

    Constructors

    Name Description
    Logger(LoggerConfig)

    Constructor

    Fields

    Name Description
    Config

    Config that was used in Logger construction

    Handle

    Unique id

    Properties

    Name Description
    MinimalLogLevelAcrossAllSystems

    Minimal LogLevel that this Logger will process (means it has sinks for it)

    SinksCount

    Returns count of sinks that this Logger has

    Methods

    Name Description
    AddSink(SinkConfiguration)

    Creates new sink using SinkConfiguration

    AddSink(SinkConfiguration, ref LogControllerScopedLock)

    Creates new sink using SinkConfiguration

    Dispose()

    Disposes the Logger. See IDisposable

    GetOrCreateSink<T>(SinkConfiguration)

    Get or create sink of type T

    GetSink(int)

    Returns sink number i. Used for debugging

    GetSink<T>()

    Returns the sink of type T. Will return first one if there are several ones of the type T

    HasSinksFor(LogLevel)

    Returns true if this Logger can process messages with LogLevel level.

    SetMinimalLogLevelAcrossAllSinks(LogLevel)

    Changes LogLevel for all sinks in the logger. No need to call UpdateMinimalLogLevelAcrossAllSinks() after this. Update will take effect only after logger's update because of async nature of the logging. So if you want to do the change synchronously - please call FlushAll()>

    UpdateMinimalLogLevelAcrossAllSinks()

    Method that updates internal cached MinimalLogLevelAcrossAllSinks, and HasNoSinks please call it if you update sink's MinimalLogLevel or add/remove sinks Update will take effect only after logger's update because of async nature of the logging. So if you want to do the change synchronously - please call FlushAll()>

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)