Interface ILogReceiver
Defines the contract for objects that receive and output formatted log entries from the Scylla
logging system. Receivers are registered with Log via
Log.RegisterLogReceiver and are called for every log entry that passes the global
filter level.
Namespace: Scylla.Core
Assembly: ScyllaCore.dll
Syntax
public interface ILogReceiver
Remarks
The framework ships with two built-in implementations:
-
UnityConsoleLog - routes log output to the Unity Editor console,
mapping LogLevel values to
Debug.Log,Debug.LogWarning, andDebug.LogError. - FileLog - writes log output asynchronously to rotating files in the user's documents folder, supporting both plain-text and JSON Lines formats.
Before LogData(LogEntry) is called the framework assembles a LogEntry struct containing all pre-formatted components (padded label, padded category, prefix, timestamp, etc.) so that each receiver does not have to repeat formatting work.
Custom receivers must be thread-safe: LogData(LogEntry) may be called from any thread.
Properties
LogLabelLevel
Gets the minimum LogLevel at which this receiver includes the descriptive
level label (e.g. [WARNING]) in its output. Messages whose level is at or above this
threshold will have the label prepended; messages below the threshold omit it.
Set to Minimum to always include the label, or to
Maximum to suppress it entirely.
Declaration
LogLevel LogLabelLevel { get; }
Property Value
| Type | Description |
|---|---|
| LogLevel |
LogPrefix
Gets the prefix string prepended to every log line emitted by this receiver.
Typically set to LOG_PREFIX (e.g. [Scylla]) so that Scylla output
is visually distinct from other console output. Implementations may return an empty string
to suppress the prefix entirely.
Declaration
string LogPrefix { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ClearLog()
Clears all previously written log output managed by this receiver, if the operation is supported. For receivers that do not support clearing (e.g. a file log that retains history), this method should return without doing anything.
Declaration
void ClearLog()
Remarks
This operation is best-effort. Implementations should silently no-op rather than throwing if clearing is not possible or applicable to the underlying output target.
LogData(LogEntry)
Writes the supplied log entry to this receiver's output destination.
The logEntry struct carries all pre-formatted components - prefix, padded
label, padded category, timestamp, code location, and data string - so the receiver only
needs to assemble and emit the final output.
Declaration
void LogData(LogEntry logEntry)
Parameters
| Type | Name | Description |
|---|---|---|
| LogEntry | logEntry | The pre-formatted log entry value object. All fields are ready for output; no additional formatting is required beyond selecting which fields to include. |
Remarks
Implementations must not throw exceptions; errors within this method should be swallowed or
reported via a fallback channel (e.g. Log.Unity) to avoid crashing the application.
This method may be called from any thread, so implementations must be thread-safe.