Exemple #1
0
        /// <summary>
        ///     Writes a ForgeException to the Forge log files
        /// </summary>
        /// <param name="ForgeException">The Forge exception to write</param>
        private static void WriteLogToFile(ForgeExceptionBase ForgeException)
        {
            CreateLogsDir();
            StreamWriter fileWriter = new StreamWriter(InfoLogFilePath);

            fileWriter.WriteLine(ForgeException.Message);

            fileWriter.Close();
        }
Exemple #2
0
        /// <summary>
        ///     General logging function, you can use this to log custom Forge exceptions.
        /// </summary>
        /// <param name="logItem">The Forge Exception type</param>
        /// <param name="logLevel">The Forge log level</param>
        private static void Log(ForgeExceptionBase logItem, int logLevel = 4)
        {
            if (ForgeSettings.LogLevel < logLevel)
            {
                return;
            }

            Debug.Log(logItem.Message);

            WriteLogToFile(logItem);
        }