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.
Inherited Members
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
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 |