/// <summary> /// Gets the corresponding log file path to the ForgeExceptionType /// </summary> /// <param name="exceptionType">The ForgeExceptionType</param> /// <returns>The absolute log file path</returns> private static string GetLogFilePath(ForgeExceptionType exceptionType = ForgeExceptionType.Info) { string logFileName; switch (exceptionType) { case ForgeExceptionType.Info: logFileName = ForgeSettings.InfoLogFile; break; case ForgeExceptionType.Critical: logFileName = ForgeSettings.CriticalLogFile; break; case ForgeExceptionType.Warning: logFileName = ForgeSettings.WarningLogFile; break; default: logFileName = ForgeSettings.InfoLogFile; break; } return(Path.Combine( GetLogDirPath(), logFileName )); }
/// <summary> /// Creates the log file. /// </summary> /// <returns>The log file.</returns> /// <param name="exceptionType">Exception type.</param> private static string CreateLogFile(ForgeExceptionType exceptionType) { string logFilePath = GetLogFilePath(exceptionType); if (!File.Exists(logFilePath)) { File.Create(logFilePath); } return(logFilePath); }