Logger Settings
Overview
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.
Creating
The Logger Settings are kept as a ScriptableObject that can be created in Unity by going to Assets -> Create -> Logging -> Logger Settings.
Configuring
Here's a preview of the inspector window:
Here are the settings available:
Assigning
The user can assign an instance of the LoggerSettings to any logger:
GlobalLogger
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.
GameObjectLogger
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.
ClassLoggers
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.
Last updated