예제 #1
0
        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);
        }
예제 #2
0
        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);
        }