public static void NewLog(LogType logType, LogLevel logLevel, string logLocation, Exception exception) { if (!IsAuthorizedLog(logLevel)) { return; } _dateTime = DateTime.Now; Log newLog = new Log { DateTime = DateTimeFormatter.FormatDateTime(_dateTime), LogType = logType, LogLevel = logLevel, LogLocation = logLocation, LogContent = exception?.Message ?? "NULL EXCEPTION", LogDetail = exception?.ToString() ?? "NULL EXCEPTION" }; NewAuthorizedLog(newLog); }
public static void NewLog(LogType logType, LogLevel logLevel, string logLocation, string logContent, string logDetail = null) { if (!IsAuthorizedLog(logLevel)) { return; } _dateTime = DateTime.Now; Log newLog = new Log { DateTime = DateTimeFormatter.FormatDateTime(_dateTime), LogType = logType, LogLevel = logLevel, LogLocation = logLocation, LogContent = logContent, LogDetail = logDetail }; NewAuthorizedLog(newLog); }