Logger Settings
Last updated
Last updated
Configure the behavior of loggers with precision using Logger Settings. Tailor each logger's functionality to meet your project's specific needs.
Each instance will retain individual settings that can then be assigned to different logger instances, to provide flexible configuration, where each logger can share the same settings or have different settings altogether.
This section will detail how to configure and assign logger settings.
The Logger Settings are kept as a ScriptableObject that can be created in Unity by going to Assets -> Create -> Logging -> Logger Settings.
Here's a preview of the inspector window:
Here are the settings available:
The user can assign an instance of the LoggerSettings to any logger:
The GlobalLogger uses a static settings file. These settings can be accessed in the Project Settings. These settings will be automatically injected when the developer calls the GlobalLogger and no further assignment is required. Read more in the GlobalLogger page.
This component has a single configuration field in the inspector: the logger settings. When using it in any GameObject, simply drag and drop or select an existing LoggerSettings into the Logger Settings field.
Read more in the GameObjectLogger page.
This assignment is the most complicated out of the three. The LoggerSettings scriptable object must be loaded with Unity's Resources and passed in the constructor:
Read more in the ClassLogger page.
Field | Type | Description |
---|---|---|
General Options
Enabled
bool
Enables or disables the logger.
Name
string
Specifies a name for the logger.
Output Options
LogToUnityConsole
bool
Determines whether logs should be sent to the Unity Console.
UnityConsoleLogFormat
LogFormat
Specifies the LogFormat for Unity Console output. This is only configurable if the LogToUnityConsole
option is enabled.
LogToExternal
bool
Enables logging to external destinations.
AssignedLogOutputs
List<LogOutputSettings>
Configures specific log outputs, such as file or custom destinations. This is only configurable if the LogToExternal
option is enabled.
LogToCallbacks
bool
Enables logging to custom callback functions.
Filtering Options
SelectedLogLevels
Bitmask
Represents selected log levels.