Browse Source

Tweaked some stuff regarding the loader and loggers

piracy-check
Anairkoen Schno 6 years ago
parent
commit
adfc9d2c12
6 changed files with 15 additions and 8 deletions
  1. +1
    -1
      IPA.Injector/Bootstrapper.cs
  2. +1
    -1
      IPA.Injector/ConsoleWindow.cs
  3. +1
    -1
      IPA.Loader/Logging/Logger.cs
  4. +1
    -3
      IPA.Loader/Logging/StandardLogger.cs
  5. +9
    -1
      IPA.Loader/Logging/UnityLogInterceptor.cs
  6. +2
    -1
      IPA.Loader/ModPrefs.cs

+ 1
- 1
IPA.Injector/Bootstrapper.cs View File

@ -14,7 +14,7 @@ namespace IPA.Injector
{
//if (Environment.CommandLine.Contains("--verbose"))
//{
Ipa.Injector.Windows.WinConsole.Initialize();
Windows.WinConsole.Initialize();
//}
}


+ 1
- 1
IPA.Injector/ConsoleWindow.cs View File

@ -5,7 +5,7 @@ using System.IO;
using System.Text;
using Microsoft.Win32.SafeHandles;
namespace Ipa.Injector.Windows
namespace IPA.Injector.Windows
{
// https://stackoverflow.com/a/48864902/3117125
static class WinConsole


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

@ -24,7 +24,7 @@ namespace IPA.Logging
internal static Logger updater => log.GetChildLogger("Updater");
internal static Logger libLoader => log.GetChildLogger("LibraryLoader");
internal static Logger loader => log.GetChildLogger("Loader");
internal static bool LogCreated => _log != null;
internal static bool LogCreated => _log != null || UnityLogInterceptor._logger != null;
/// <summary>
/// The standard format for log messages.


+ 1
- 3
IPA.Loader/Logging/StandardLogger.cs View File

@ -52,15 +52,13 @@ namespace IPA.Logging
/// <summary>
/// All levels defined by this filter will be sent to loggers. All others will be ignored.
/// </summary>
public static LogLevel PrintFilter { get; set; } = LogLevel.InfoUp;
public static LogLevel PrintFilter { get; set; } = ModPrefs.GetBool("IPA", "PrintDebug", false, true) ? LogLevel.All : LogLevel.InfoUp;
private List<LogPrinter> printers = new List<LogPrinter>(defaultPrinters);
private Dictionary<string, StandardLogger> children = new Dictionary<string, StandardLogger>();
static StandardLogger()
{
if (ModPrefs.GetBool("IPA", "PrintDebug", false, true))
PrintFilter = LogLevel.All;
showSourceClass = ModPrefs.GetBool("IPA", "DebugShowCallSource", false, true);
}


+ 9
- 1
IPA.Loader/Logging/UnityLogInterceptor.cs View File

@ -9,7 +9,15 @@ namespace IPA.Logging
{
internal class UnityLogInterceptor
{
public static Logger UnityLogger = new StandardLogger("UnityEngine");
internal static Logger _logger;
public static Logger UnityLogger {
get
{
if (_logger == null)
_logger = new StandardLogger("UnityEngine");
return _logger;
}
}
public static Logger.Level LogTypeToLevel(LogType type)
{


+ 2
- 1
IPA.Loader/ModPrefs.cs View File

@ -186,7 +186,8 @@ namespace IPA
if (sVal == "1" || sVal == "0")
{
return sVal == "1";
} else if (autoSave)
}
else if (autoSave)
{
(this as IModPrefs).SetBool(section, name, defaultValue);
}


Loading…
Cancel
Save