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")) //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 System.Text;
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
namespace Ipa.Injector.Windows
namespace IPA.Injector.Windows
{ {
// https://stackoverflow.com/a/48864902/3117125 // https://stackoverflow.com/a/48864902/3117125
static class WinConsole 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 updater => log.GetChildLogger("Updater");
internal static Logger libLoader => log.GetChildLogger("LibraryLoader"); internal static Logger libLoader => log.GetChildLogger("LibraryLoader");
internal static Logger loader => log.GetChildLogger("Loader"); internal static Logger loader => log.GetChildLogger("Loader");
internal static bool LogCreated => _log != null;
internal static bool LogCreated => _log != null || UnityLogInterceptor._logger != null;
/// <summary> /// <summary>
/// The standard format for log messages. /// The standard format for log messages.


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

@ -52,15 +52,13 @@ namespace IPA.Logging
/// <summary> /// <summary>
/// All levels defined by this filter will be sent to loggers. All others will be ignored. /// All levels defined by this filter will be sent to loggers. All others will be ignored.
/// </summary> /// </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 List<LogPrinter> printers = new List<LogPrinter>(defaultPrinters);
private Dictionary<string, StandardLogger> children = new Dictionary<string, StandardLogger>(); private Dictionary<string, StandardLogger> children = new Dictionary<string, StandardLogger>();
static StandardLogger() static StandardLogger()
{ {
if (ModPrefs.GetBool("IPA", "PrintDebug", false, true))
PrintFilter = LogLevel.All;
showSourceClass = ModPrefs.GetBool("IPA", "DebugShowCallSource", false, true); 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 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) 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") if (sVal == "1" || sVal == "0")
{ {
return sVal == "1"; return sVal == "1";
} else if (autoSave)
}
else if (autoSave)
{ {
(this as IModPrefs).SetBool(section, name, defaultValue); (this as IModPrefs).SetBool(section, name, defaultValue);
} }


Loading…
Cancel
Save