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) 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; continue;
} }


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

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


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

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


BIN
Refs/UnityEngine.CoreModule.dll View File


Loading…
Cancel
Save