logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityConsoleLogService

    Unity-specific console logging service implementation that outputs logs to Unity's Console window.
    Extends UnityLogService to provide specialized console output formatting with proper Unity Debug API integration.
    Handles different log severities with appropriate Unity console methods (Debug.Log, Debug.LogWarning, Debug.LogError, Debug.LogException) and includes severity-based filtering and message formatting.

    Inheritance
    object
    UnityLogService
    UnityConsoleLogService
    Implements
    ILogService
    IService
    IFoundationSettings
    Inherited Members
    UnityLogService._settings
    UnityLogService._overrides
    UnityLogService.Initialize(CreateLogServiceDTO)
    UnityLogService.GetEffectiveVerbosity(string)
    UnityLogService.SetCategoryVerbosity(string, LogVerbosity?)
    UnityLogService.ClearCategoryVerbosity(string)
    UnityLogService.IsEnabledFor(string, LogSeverity)
    UnityLogService.WriteVerboseLog(string, string, params string[])
    UnityLogService.WriteInformationLog(string, string, params string[])
    UnityLogService.WriteWarningLog(string, string, params string[])
    UnityLogService.WriteErrorLog(string, string, params string[])
    UnityLogService.WriteExceptionLog(Exception, string, string, params string[])
    UnityLogService.For(string)
    UnityLogService.Verbosity
    UnityLogService.LogService
    UnityLogService.Id
    UnityLogService.Guid
    Namespace: Serenity.Logging.Infrastructure.Services
    Assembly: Serenity.UnityGlobal.Infrastructure.dll
    Syntax
    public class UnityConsoleLogService : UnityLogService, ILogService, IService, IFoundationSettings

    Constructors

    UnityConsoleLogService()

    Declaration
    public UnityConsoleLogService()

    Methods

    Format(LogEntry, bool)

    Formats log entry with Unity Editor rich text color coding based on severity.
    Extends base formatting with conditional rich text coloring for warnings (yellow) and errors/exceptions (red) when UseRichText setting is enabled. Only applies rich text formatting in Unity Editor environment.

    Declaration
    protected override string Format(LogEntry e, bool prefixOnly = false)
    Parameters
    Type Name Description
    LogEntry e

    Log entry to format

    bool prefixOnly

    Whether to format only the prefix portion of the message

    Returns
    Type Description
    string

    Formatted log message string with optional rich text coloring

    Overrides
    UnityLogService.Format(LogEntry, bool)

    WriteLog(LogEntry)

    Writes a log entry to Unity's Console window with appropriate severity handling.
    Routes different log severities to corresponding Unity Debug methods and handles exceptions with special Debug.LogException formatting. Includes severity-based filtering and message formatting before output.

    Declaration
    public override void WriteLog(LogEntry e)
    Parameters
    Type Name Description
    LogEntry e

    Log entry containing message, severity, category, and optional exception

    Overrides
    UnityLogService.WriteLog(LogEntry)

    Implements

    ILogService
    IService
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved