예제 #1
0
        private void LoadSettings()
        {
            // Loads or creates the settings for the plugin
            if (!SettingsManager.Instance.TryLoad(GetType(), out settings))
            {
                settings = new Settings();
                LogWarning("Settings not found => created");
            }
            else
            {
                LogInfo("Settings found and loaded");
            }
            var ass     = Assembly.GetExecutingAssembly().GetName();
            var version = ass.Version.ToString();

            if (!version.Equals(settings.Version))
            {
                // Reset some settings when new version is deployed
                settings.UseLog = true;
            }
            if (settings.UseLog == null)
            {
                settings.UseLog = LogUsage.PromptToLog();
            }
            settings.Version = version;
        }
예제 #2
0
 internal void LogUse(string action, bool forceLog = false)
 {
     ai.WriteEvent(action);
     if (settings == null)
     {
         LoadSettings();
     }
     if (settings.UseLog == true || forceLog)
     {
         LogUsage.DoLog(action);
     }
 }