Esempio n. 1
0
        /// <summary>
        ///     Main entry point which is called by QMods. Specified in mod.json
        /// </summary>
        public static void Load()
        {
            Config = YamlConfigReader.Readconfig <FishOverflowDistributorConfig>(
                ConfigFilePath,
                x =>
            {
                Console.WriteLine(
                    $"[{ModName}] [Fatal] Error parsing config file '{ConfigFilePath}. {Environment.NewLine}");

                Console.WriteLine(ExceptionUtils.GetExceptionErrorString(x));
            });

            if (Config == null)
            {
                return;
            }


            Logger = new QModLogger()
                     .WithTarget(new QModFileLoggerTarget(LogFilePath, Config.LogLevel))
                     .WithTarget(new SubnauticaConsoleLoggerTarget(ModName, LogLevel.Error))
                     .Open();

            SceneManager.sceneLoaded   += OnSceneLoaded;
            SceneManager.sceneUnloaded += OnSceneUnloaded;

            OnGameStart();
        }
Esempio n. 2
0
        public void LogException(Exception e, string prependingText)
        {
            string result = prependingText + Environment.NewLine;

            result += ExceptionUtils.GetExceptionErrorString(e);
            LogFatal(result);
        }