Browse Source

Added Notice log level

No plugin type error now a Notice level
pull/11/head
Anairkoen Schno 5 years ago
parent
commit
1f8f213c3f
4 changed files with 44 additions and 2 deletions
  1. +7
    -1
      IPA.Loader/Loader/PluginLoader.cs
  2. +32
    -1
      IPA.Loader/Logging/Logger.cs
  3. +5
    -0
      IPA.Loader/Logging/StandardLogger.cs
  4. BIN
      Refs/UnityEngine.CoreModule.dll

+ 7
- 1
IPA.Loader/Loader/PluginLoader.cs View File

@ -171,7 +171,13 @@ namespace IPA.Loader
if (metadata.PluginType == null)
{
Logger.loader.Warn($"Could not find plugin type for {Path.GetFileName(plugin)}");
Logger.loader.Notice(
#if DIRE_LOADER_WARNINGS
$"Could not find plugin type for {Path.GetFileName(plugin)}"
#else
$"New plugin type not present in {Path.GetFileName(plugin)}; maybe an old plugin?"
#endif
);
continue;
}


+ 32
- 1
IPA.Loader/Logging/Logger.cs View File

@ -53,6 +53,11 @@ namespace IPA.Logging
/// </summary>
Info = 2,
/// <summary>
/// A notice. More significant than Info, but less than a warning.
/// </summary>
Notice = 32,
/// <summary>
/// A warning message.
/// </summary>
@ -90,6 +95,11 @@ namespace IPA.Logging
/// </summary>
InfoOnly = Level.Info,
/// <summary>
/// Only shows notice messages.
/// </summary>
NoticeOnly = Level.Notice,
/// <summary>
/// Only shows Warning messages.
/// </summary>
@ -115,10 +125,15 @@ namespace IPA.Logging
/// </summary>
WarningUp = WarningOnly | ErrorUp,
/// <summary>
/// Shows all messages Notice and up.
/// </summary>
NoticeUp = WarningUp | NoticeOnly,
/// <summary>
/// Shows all messages info and up.
/// </summary>
InfoUp = InfoOnly | WarningUp,
InfoUp = InfoOnly | NoticeUp,
/// <summary>
/// Shows all messages.
@ -176,6 +191,22 @@ namespace IPA.Logging
/// </summary>
/// <param name="e">the exception to log</param>
public virtual void Info(Exception e) => Log(Level.Info, e);
/// <summary>
/// Sends a notice message.
/// Equivalent to Log(Level.Notice, message).
/// <see cref="Log(Level, string)"/>
/// </summary>
/// <param name="message">the message to log</param>
public virtual void Notice(string message) => Log(Level.Notice, message);
/// <summary>
/// Sends an exception as a notice message.
/// Equivalent to Log(Level.Notice, e);
/// <see cref="Log(Level, Exception)"/>
/// </summary>
/// <param name="e">the exception to log</param>
public virtual void Notice(Exception e) => Log(Level.Notice, e);
/// <summary>
/// Sends a warning message.


+ 5
- 0
IPA.Loader/Logging/StandardLogger.cs View File

@ -35,6 +35,11 @@ namespace IPA.Logging
Color = ConsoleColor.White,
},
new ColoredConsolePrinter()
{
Filter = LogLevel.NoticeOnly,
Color = ConsoleColor.Cyan
},
new ColoredConsolePrinter()
{
Filter = LogLevel.WarningOnly,
Color = ConsoleColor.Yellow,


BIN
Refs/UnityEngine.CoreModule.dll View File


Loading…
Cancel
Save