Logix
Logix is a structured logging framework for Unity. Call Log.Info(...) from anywhere and it flows through filters, a formatter, and out to sinks.
using Logix;
public class Player : MonoBehaviour
{
private void Start()
{
Log.Info("Game started!");
Log.Warning("Low ammo");
Log.Error("Connection lost", throwException: false);
}
}
Open the editor window: Tools / Dajno / Logix
Setup
Logix works out of the box. The Unity initializer adds a UnityLogSink and loads settings from LogixRuntimeSettings.asset in Resources.
To customize:
Log.WithOptions(o => o.MinLogLevel = LogLevel.Warning)
.AddSink(new FileLogSink("Logs.txt"))
.AddFilter(new LevelFilter(LogLevel.Info));