UI Toolbox logoUI Toolbox

Logging

ToolboxLogger.Instance filters messages by level and category. The default global level is Warning, for LogSettings and for a new ToolboxLogConfig asset.

LogCategory Content
General Messages that fit no other category. The samples use it.
DragDrop Drag and drop, merge, tear-off. Many messages during pointer movement.
Window Window registration, state, chrome and templates.
Animation Reserved. The runtime does not log in this category today.
Layout Layout calculation and geometry.
Input Input handling and gesture recognition.
Lifecycle Chrome lifecycle: state transitions, initialization, cleanup.

LogLevel values, from least to most output: Disabled, Error, Warning, Info, Debug, Trace.

Configure logging in code:

using UIToolbox.Logging;

public static class LogSetup
{
    public static void Apply()
    {
        var settings = LogSettings.CreateDefault();
        settings.SetCategoryLevel(LogCategory.DragDrop, LogLevel.Debug);
        ToolboxLogger.Initialize(settings);
    }
}

Or create an asset with the menu Assets > Create > UI Toolbox > Log Configuration and pass it to ToolboxLogger.Initialize(ToolboxLogConfig).

LogSettings.CreateDebug() and LogSettings.CreateTrace() are presets. UIToolbox.Utils.LoggingHelper has shortcuts: ConfigureQuietMode, ConfigureDebugMode, EnableCategoryDebugging, ConfigureMergeDebugging.