skner's Logging Toolkit
  • Welcome to skner's Logging Toolkit for Unity
  • Changelog
  • Examples
  • Getting Started
  • Introduction
  • Loggers
    • Class Logger
    • Game Object Logger
    • Global Logger
  • Models
    • Log Context
    • Log Format
    • Log Path
    • Log Tag Holder
  • Output Modules
    • Output Modules
  • Settings
    • Log Level Settings
    • Log Output Settings
    • Logger Settings
Powered by GitBook
On this page
  • Overview
  • Configuring
  • Using
  1. Loggers

Global Logger

Last updated 1 year ago

Overview

The GlobalLogger is a singleton logger. It facilitates logging throughout the project and uses a centralized configuration.

Configuring

The configuration for GlobalLogger is located in the Project Settings:

This references a ScriptableObject that comes pre-packaged in the Resources folder. Editing these files outside of the Project Settings is possible, but it can lead to unexpected behaviours that are not supported by the toolkit.

Using

To use the GlobalLogger in any project script, ensure the script references the following namespace:

using skner.LoggingToolkit.Loggers;

The GlobalLogger uses a static Instance that is accessible through the project and is initialized on load.

Call any of the available Log methods from the GlobalLogger's Instance:

GlobalLogger.Instance.LogDebug("Logging a debug message.");
GlobalLogger Settings