Browse Source

Created an IPA config source

Moved some logger init stuff around
pull/46/head
Anairkoen Schno 5 years ago
parent
commit
6a2114697a
2 changed files with 7 additions and 1 deletions
  1. +5
    -0
      IPA.Loader/Loader/PluginManager.cs
  2. +2
    -1
      IPA.Loader/Logging/StandardLogger.cs

+ 5
- 0
IPA.Loader/Loader/PluginManager.cs View File

@ -77,6 +77,8 @@ namespace IPA.Loader
}
private static List<IPlugin> _ipaPlugins = null;
internal static IConfigProvider SelfConfigProvider { get; set; } = null;
internal static List<IConfigProvider> configProviders = new List<IConfigProvider>();
private static void LoadPlugins()
@ -162,6 +164,9 @@ namespace IPA.Loader
_bsPlugins.Add(selfPlugin);
configProviders.Add(SelfConfigProvider = new JsonConfigProvider() { Filename = Path.Combine("UserData", SelfPlugin.IPA_Name) });
SelfConfigProvider.Load();
//Load copied plugins
string[] copiedPlugins = Directory.GetFiles(cacheDir, "*.dll");
foreach (string s in copiedPlugins)


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

@ -53,7 +53,7 @@ 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; } = ModPrefs.GetBool("IPA", "PrintDebug", false, true) ? LogLevel.All : LogLevel.InfoUp;
public static LogLevel PrintFilter { get; set; }
private List<LogPrinter> printers = new List<LogPrinter>(defaultPrinters);
private Dictionary<string, StandardLogger> children = new Dictionary<string, StandardLogger>();
@ -61,6 +61,7 @@ namespace IPA.Logging
static StandardLogger()
{
showSourceClass = ModPrefs.GetBool("IPA", "DebugShowCallSource", false, true);
PrintFilter = ModPrefs.GetBool("IPA", "PrintDebug", false, true) ? LogLevel.All : LogLevel.InfoUp;
}
private StandardLogger(string mainName, string subName, params LogPrinter[] inherited)


Loading…
Cancel
Save