using BepInEx.Logging;
namespace BepInEx
{
///
/// A static instance.
///
public static class Logger
{
///
/// The current instance of a that is being used.
///
public static BaseLogger CurrentLogger { get; set; }
///
/// The listener event for an entry being logged.
///
public static event BaseLogger.EntryLoggedEventHandler EntryLogged;
///
/// Logs an entry to the current logger instance.
///
/// The level of the entry.
/// The textual value of the entry.
public static void Log(LogLevel level, object entry)
{
EntryLogged?.Invoke(level, entry);
CurrentLogger?.Log(level, entry);
}
///
/// Sets the instance being used by the static class.
///
/// The instance to use in the static class.
public static void SetLogger(BaseLogger logger)
{
CurrentLogger?.Dispose();
CurrentLogger = logger;
}
}
}