Backbone - Logger
 
Loading...
Searching...
No Matches
Backbone::LoggerConfig Class Reference

ScriptableObject configuration for the Logger. Allows setting default categories, their colors, and global log level directly from the Unity Inspector. More...

Inheritance diagram for Backbone::LoggerConfig:

Classes

class  CategoryEntry
 Represents a single log category with activation state and color. More...
 

Public Member Functions

void EnsureDefaultCategories ()
 Ensures that default categories are present in the configuration.
 
void ApplyConfig ()
 Applies the configuration to the global Logger system.
 
Color GetCategoryColor (string category)
 Returns the color assigned to a specific category.
 

Public Attributes

class Backbone::LoggerConfig::CategoryEntry groupByPrefix = false
 Controls if categories must be displayer grouped by prefix.
 
LoggerColorMode colorMode = LoggerColorMode.CategoryOnly
 Controls which parts of the log will be colored in the console.
 
LogLevel globalLevel = LogLevel.Debug
 Global minimum log level for filtering messages.
 
List< CategoryEntrycategories = new List<CategoryEntry>()
 List of categories that can be managed from the Unity Inspector.
 

Private Member Functions

void OnEnable ()
 Called automatically when the ScriptableObject is loaded or created. Guarantees default categories are added the very first time.
 
void OnValidate ()
 Automatically populate defaults when the asset is first created. This triggers right after creation in Unity.
 

Static Private Member Functions

static readonly (string name, Color color)[] DefaultCategories
 Default categories with their associated colors.
 
static void CheckLoggerStatusOnStart ()
 Called automatically when Unity starts playing. Logs a message depending on whether ENABLE_LOGGING is active.
 

Detailed Description

ScriptableObject configuration for the Logger. Allows setting default categories, their colors, and global log level directly from the Unity Inspector.

Member Function Documentation

◆ ApplyConfig()

void Backbone::LoggerConfig::ApplyConfig ( )

Applies the configuration to the global Logger system.

◆ CheckLoggerStatusOnStart()

static void Backbone::LoggerConfig::CheckLoggerStatusOnStart ( )
staticprivate

Called automatically when Unity starts playing. Logs a message depending on whether ENABLE_LOGGING is active.

◆ EnsureDefaultCategories()

void Backbone::LoggerConfig::EnsureDefaultCategories ( )

Ensures that default categories are present in the configuration.

◆ GetCategoryColor()

Color Backbone::LoggerConfig::GetCategoryColor ( string category)

Returns the color assigned to a specific category.

Parameters
categoryThe category name.
Returns
The configured color or white if the category does not exist.

◆ OnEnable()

void Backbone::LoggerConfig::OnEnable ( )
private

Called automatically when the ScriptableObject is loaded or created. Guarantees default categories are added the very first time.

◆ OnValidate()

void Backbone::LoggerConfig::OnValidate ( )
private

Automatically populate defaults when the asset is first created. This triggers right after creation in Unity.

◆ readonly()

static Backbone::LoggerConfig::readonly ( string name,
Color color )
staticprivate

Default categories with their associated colors.

Member Data Documentation

◆ categories

List<CategoryEntry> Backbone::LoggerConfig::categories = new List<CategoryEntry>()

List of categories that can be managed from the Unity Inspector.

◆ colorMode

LoggerColorMode Backbone::LoggerConfig::colorMode = LoggerColorMode.CategoryOnly

Controls which parts of the log will be colored in the console.

◆ globalLevel

LogLevel Backbone::LoggerConfig::globalLevel = LogLevel.Debug

Global minimum log level for filtering messages.

◆ groupByPrefix

class Backbone::LoggerConfig::CategoryEntry Backbone::LoggerConfig::groupByPrefix = false

Controls if categories must be displayer grouped by prefix.


The documentation for this class was generated from the following file: