Freyja Logger
Freyja Logger a versatile logging library for Unity applications
This package offering:
Prefix-based Categorization: Organize your logs by prefixing them with specific identifiers.
Configurable Log Levels:: Control the verbosity of your logs by enabling or disabling log levels (info, warning, error).
Contextual Logging:: Log messages with additional context information, such as the object that triggered the log.
Formatted Output:: Use format strings to create detailed and informative log messages.
Customization:
Enable/Disable Logging: Set
IsEnable
property on the Logger instance.Enable/Disable Log Levels: Set
EnableLogWarning
andEnableLogError
properties.
Additional Features:
Contextual Logging: Pass an object as the first argument to include its type name.
Formatted Output: Use format strings for detailed logs.
Requirements
Unity 2021.3.22.f1 or later
Dependencies
Installation
Install from Unity Package Manager -> (
Window -> Package Manager -> Add package from git URL
)

Copy and Paste this URL link https://github.com/winartodev/Freyja-Logger.git
Example Usage
For a more convenient way to use the Freyja Logger, you can create a static class file like DebugLog.cs
to manage the Logger instance:
using Freyja.Logger;
public class DebugLog
{
private static Logger _show;
public static Logger Show
{
get
{
if (_show == null)
{
_show = Logger.AddLog("DebugLog");
}
return _show;
}
}
}
Then, you can use the DebugLog.Show
property to access the Logger instance directly:
using UnityEngine;
public class TestDebugLog : MonoBehaviour
{
private void Start()
{
DebugLog.Show.Log(this, "Test Log"); // output: [DebugLog] [TestDebugLog] Test Log
DebugLog.Show.LogWarning(this, "Test Log Warning"); // output: [DebugLog] [TestDebugLog] Test Log Warning
DebugLog.Show.LogError(this, "Test Log Error"); // output: [DebugLog] [TestDebugLog] Test Log Error
}
}
Last updated