{!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} Struct LogController | Unity Logging | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct LogController

    Burst-friendly backend for Logger that contains LoggerHandle, LogMemoryManager, DispatchQueue and is able to answer if this particular LogLevel is supported by this Logger.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Logging
    Assembly: solution.dll
    Syntax
    public struct LogController

    Constructors

    Name Description
    LogController(LoggerHandle, in LogMemoryManagerParameters)

    Constructor that initializes MemoryManager and DispatchQueue. Uses LoggerHandle provided by the caller.

    Fields

    Name Description
    DispatchQueue

    Double-buffered queue that is used for dispatching LogMessages. DispatchQueue

    Handle

    Unique id of the Logger

    MemoryManager

    Memory manager that stores binary representation of structured logging. LogMemoryManager

    SyncMode

    Current synchronization mode

    Properties

    Name Description
    IsCreated

    True if Logging system has been initialized.

    NeedsStackTrace

    True if any sink requested stack trace. If this is false - logging would work faster.

    Methods

    Name Description
    AddDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>)

    The function that can add function based decorator. Internally used by LogDecorateHandlerScope, better to use that instead. RemoveDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>)

    AddSinkStruct(SinkSystemBase)

    Creates new sink using SinkSystemBase's ToSinkStruct method

    BeginEditDecoratePayloadHandles(in LogControllerScopedLock, out int)

    Function that is called by the logging codegeneration.

    Used to populate Decorate array. See LogDecorateScope documentation for more details

    This function is called before decoration, EndEditDecoratePayloadHandles(ref LogController, int) must be called after LogDecorateScope
    DecorateHandlerCount()

    Returns count of Function-based Decorators (that you can add with Log.Decorate(function) or AddDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>) and remove with RemoveDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>)) They will be executed each time log message is created

    DecoratePayloadsCount()

    Returns count of constant Decorators (that you can add with Log.Decorate("name", value)) They will be copied to new log message payload each time log message is created

    DispatchMessage(PayloadHandle, long, LogLevel)

    Dispatches a LogMessage

    EndEditDecoratePayloadHandles(ref LogController, int)

    Function that is called by the logging codegeneration.

    Used to populate Decorate array. See LogDecorateScope documentation for more details

    This function is called after decoration, BeginEditDecoratePayloadHandles(in LogControllerScopedLock, out int) must be called before LogDecorateScope
    FlushSync()

    Burst-friendly way to immediately and synchronously Update/Flush the DispatchQueue into sinks. This is a slower alternative to LoggerManager.ScheduleUpdate but can be called from Burst / not main thread.

    HasSinksFor(LogLevel)

    Returns true if the LogLevel is supported by at least one SinkSystemBase in this LogController

    LogDispatched()

    Count of log messages dispatched and waiting to be processed

    MustBeValid()

    Checks that IsCreated == true. Throws otherwise.

    RemoveDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>)

    The function that remove function based decorator that was added by AddDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>) Internally used by LogDecorateHandlerScope, better to use that instead. AddDecorateHandler(FunctionPointer<OutputWriterDecorateHandler>)

    SetMinimalLogLevelForSink(int, LogLevel)

    Changes the minimal level of the sink

    Shutdown()

    Stops Logging and releases the memory and destroys systems created by LogController.

    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)