docs.unity3d.com
    Show / Hide Table of Contents

    Struct LogMessage

    The struct for dispatching and processing log messages.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Logging
    Syntax
    public readonly struct LogMessage : IComparable<LogMessage>
    Remarks

    Log message data is allocated and stored using LogMemoryManager, which is referenced by this struct via a PayloadHandle. Log messages can be dispatched through DispatchMessage(PayloadHandle, Int64, LogLevel).

    Constructors

    LogMessage(PayloadHandle, Int64, Int64, LogLevel)

    Create a new LogMessage

    Declaration
    public LogMessage(PayloadHandle payload, long timestamp, long stacktraceId, LogLevel level)
    Parameters
    Type Name Description
    PayloadHandle payload

    PayloadHandle of the binary data

    Int64 timestamp

    Timestamp of the message

    Int64 stacktraceId

    Id of stacktrace connected to this message, or 0

    LogLevel level

    LogLevel of this message

    Fields

    Level

    Log Level: Verbose, Debug, Info, Warning, Error, Fatal

    Declaration
    public readonly LogLevel Level
    Field Value
    Type Description
    LogLevel

    Payload

    References the log message data allocated through LogMemoryManager.

    Declaration
    public readonly PayloadHandle Payload
    Field Value
    Type Description
    PayloadHandle

    StackTraceId

    StackTraceId

    Declaration
    public readonly long StackTraceId
    Field Value
    Type Description
    Int64

    Timestamp

    Timestamp to sort messages

    Declaration
    public readonly long Timestamp
    Field Value
    Type Description
    Int64

    Methods

    CompareTo(LogMessage)

    Compares this LogMessage to another. Compares only timestamps. Needed for timestamp sorting

    Declaration
    public readonly int CompareTo(LogMessage other)
    Parameters
    Type Name Description
    LogMessage other

    Another LogMessage

    Returns
    Type Description
    Int32

    True if timestamps are the same

    Implements
    IComparable<T>.CompareTo(T)
    In This Article
    • Constructors
      • LogMessage(PayloadHandle, Int64, Int64, LogLevel)
    • Fields
      • Level
      • Payload
      • StackTraceId
      • Timestamp
    • Methods
      • CompareTo(LogMessage)
    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