Browse Source

Created an IPA config source

Moved some logger init stuff around
pull/46/head
Anairkoen Schno 6 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; private static List<IPlugin> _ipaPlugins = null;
internal static IConfigProvider SelfConfigProvider { get; set; } = null;
internal static List<IConfigProvider> configProviders = new List<IConfigProvider>(); internal static List<IConfigProvider> configProviders = new List<IConfigProvider>();
private static void LoadPlugins() private static void LoadPlugins()
@ -162,6 +164,9 @@ namespace IPA.Loader
_bsPlugins.Add(selfPlugin); _bsPlugins.Add(selfPlugin);
configProviders.Add(SelfConfigProvider = new JsonConfigProvider() { Filename = Path.Combine("UserData", SelfPlugin.IPA_Name) });
SelfConfigProvider.Load();
//Load copied plugins //Load copied plugins
string[] copiedPlugins = Directory.GetFiles(cacheDir, "*.dll"); string[] copiedPlugins = Directory.GetFiles(cacheDir, "*.dll");
foreach (string s in copiedPlugins) foreach (string s in copiedPlugins)


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

@ -53,7 +53,7 @@ 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; } = 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 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>();
@ -61,6 +61,7 @@ namespace IPA.Logging
static StandardLogger() static StandardLogger()
{ {
showSourceClass = ModPrefs.GetBool("IPA", "DebugShowCallSource", false, true); 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) private StandardLogger(string mainName, string subName, params LogPrinter[] inherited)


Loading…
Cancel
Save