Browse Source

Added option to disable Debug console spam

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
45d73d41cd
2 changed files with 9 additions and 2 deletions
  1. +1
    -1
      IllusionInjector/Logging/Printers/ColoredConsolePrinter.cs
  2. +8
    -1
      IllusionInjector/Logging/StandardLogger.cs

+ 1
- 1
IllusionInjector/Logging/Printers/ColoredConsolePrinter.cs View File

@ -19,7 +19,7 @@ namespace IllusionInjector.Logging.Printers
public override void Print(LoggerBase.Level level, DateTime time, string logName, string message)
{
if (((byte)level & (byte)Filter) == 0) return;
if (((byte)level & (byte)StandardLogger.PrintFilter) == 0) return;
Console.ForegroundColor = color;
foreach (var line in message.Split(new string[] { "\n", Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
Console.WriteLine(string.Format(LoggerBase.LogFormat, line, logName, time, level.ToString().ToUpper()));


+ 8
- 1
IllusionInjector/Logging/StandardLogger.cs View File

@ -1,4 +1,5 @@
using IllusionInjector.Logging.Printers;
using IllusionPlugin;
using IllusionPlugin.Logging;
using System;
using System.Collections.Concurrent;
@ -59,9 +60,15 @@ namespace IllusionInjector.Logging
private string logName;
private static LogLevel showFilter = LogLevel.InfoUp;
public static LogLevel Filter { get => showFilter; set => showFilter = value; }
public static LogLevel PrintFilter { get => showFilter; set => showFilter = value; }
private List<LogPrinter> printers = new List<LogPrinter>(defaultPrinters);
static StandardLogger()
{
if (ModPrefs.GetBool("IPA", "PrintDebug", false, true))
showFilter = LogLevel.All;
}
internal StandardLogger(string name)
{
logName = name;


Loading…
Cancel
Save