A simple ImGui-based logger class library designed specifically for ExileCore2 plugins. This is not a standalone logging solution and requires ExileCore2 and ImGui.NET to function.
- ImGui-based visual logging window
- Multiple log levels (Debug, Info, Warning, Error)
- Color-coded log entries
- Thread-safe logging using ConcurrentQueue
- Auto-scrolling to latest log entries
- Maximum entry limit to prevent memory issues
- Pause/Resume logging functionality
- Log level filtering via dropdown
- JSON object logging support
- Buffer size monitoring
- Clear log functionality
- Seamless integration with ExileCore2's ImGui implementation
- .NET 8.0
- ImGui.NET (1.91.6.1 or higher)
- Newtonsoft.Json (13.0.3 or higher)
- ExileCore2 environment
- Add the project as a reference to your ExileCore2 plugin
- Or install via NuGet:
dotnet add package ExileCore2CustomLogger
// import the logger namespace
using Logger = ExileCore2CustomLogger.Logger;
// Initialize the logger with custom log level and max entries
var logLevel = LogLevel.Debug;
// or from ExileCore2 Settings
var logLevel = (LogLevel)Settings.LogLevel.Value;
var logger = new Logger(logLevel, maxEntries: 2000);
// Log messages
logger.Debug("Debug message");
logger.Info("Info message");
logger.Warning("Warning message");
logger.Error("Error message");
// Log object as formatted JSON
var myObject = new { Name = "Test", Value = 123 };
logger.LogJson(myObject);
// Render the logger window (typically in your plugin's Render method)
public override void Render()
{
if (Settings.Debug.ShowWindow)
{
logger.Render();
}
}
The logger can be initialized with custom log level and maximum entries:
// Default: LogLevel.Info, 1000 entries
var logger = new Logger();
var logLevel = LogLevel.Debug;
// Custom configuration
var logger = new Logger(LogLevel.Debug, maxEntries: 2000);
- Clear: Clears all log entries
- Pause/Resume: Freezes the log display for easier reading
- Auto-scroll: Automatically scrolls to newest entries
- Log Level: Dropdown to filter minimum log level
- Buffer Size: Shows current/maximum entry count
MIT License
Created for use with ExileCore2 plugins.