using System;
using BepInEx.Logging;
namespace BepInEx
{
///
/// A helper class to use for logging.
///
[Obsolete("This class has been deprecated; please use the Logger static class and BaseLogger implementations", true)]
public static class BepInLogger
{
///
/// The handler for a entry logged event.
///
/// The text element of the log itself.
/// Whether or not it should be dislpayed to the user.
public delegate void EntryLoggedEventHandler(string entry, bool show = false);
///
/// The listener event for an entry being logged.
///
public static event EntryLoggedEventHandler EntryLogged;
///
/// Logs an entry to the logger, and any listeners are notified of the entry.
///
/// The text element of the log itself.
/// Whether or not it should be dislpayed to the user.
public static void Log(string entry, bool show = false)
{
Logger.Log(show ? LogLevel.Message : LogLevel.Info, entry);
EntryLogged?.Invoke(entry, show);
}
///
/// Logs an entry to the logger, and any listeners are notified of the entry.
///
/// The text element of the log itself. Uses .ToString().
/// Whether or not it should be dislpayed to the user.
/// The color of the text to show in the console.
public static void Log(object entry, bool show, ConsoleColor color)
{
Log(entry.ToString(), show);
}
///
/// Logs an entry to the logger, and any listeners are notified of the entry.
///
/// The text element of the log itself.
/// Whether or not it should be dislpayed to the user.
/// The color of the text to show in the console.
public static void Log(string entry, bool show, ConsoleColor color)
{
Log(entry, show);
}
}
}