public void LogInfo(LoggingTypeModel.LogCategory logCategory, Exception exception) { if (!LoggingLevelEnabled.Decide(LoggingLevel).Info) { return; } _logger.WriteToErrorLog("INFO", logCategory, GenerateError.GetException(exception), DateTime.Now); }
/// <summary> /// Logs a new record to the Log Store as a type Error with the given String Message. /// </summary> /// <param name="logCategory"></param> /// <param name="message"></param> public static void LogInfo(LoggingTypeModel.LogCategory logCategory, string message) { try { Console.WriteLine($"{DateTime.Now} - {logCategory} - {message}"); LoggerInterface.LogInfo(logCategory, message); } catch { } }
/// <summary> /// Logs a new record to the Log Store as a type Error with the given exception. /// </summary> /// <param name="logCategory"></param> /// <param name="exception"></param> public static void LogDebug(LoggingTypeModel.LogCategory logCategory, Exception exception) { try { Console.WriteLine($"{DateTime.Now} - {logCategory} - {exception}"); LoggerInterface.LogDebug(logCategory, exception); } catch { } }
public void LogDebug(LoggingTypeModel.LogCategory logCategory, string message) { CheckArchive(); if (!LoggingLevelEnabled.Decide(LoggingLevel).Debug) { return; } SetupLogLocation(); _loggingFile.WriteToErrorLog("DEBUG", logCategory, message, DateTime.Now); }
public void LogDebug(LoggingTypeModel.LogCategory logCategory, Exception exception) { CheckArchive(); if (!LoggingLevelEnabled.Decide(LoggingLevel).Debug) { return; } SetupLogLocation(); _loggingFile.WriteToErrorLog("DEBUG", logCategory, GenerateError.GetException(exception), DateTime.Now); }
public void LogInfo(LoggingTypeModel.LogCategory logCategory, string message) { CheckArchive(); if (!LoggingLevelEnabled.Decide(LoggingLevel).Info) { return; } SetupLogLocation(); _loggingFile.Write("INFO", logCategory, message, DateTime.Now); }
public IReadOnlyCollection <Error> ReadSpecificCategory(LoggingTypeModel.LogCategory category) { var command = "SELECT * FROM Error WHERE ErrorType = @Category ORDER BY DateTimeUTC DESC"; var sqlitecommand = new SQLiteCommand(command, _dbConnection); sqlitecommand.Parameters.AddWithValue("@Category", category.ToString()); var reader = ExecuteSqLiteNonQuery(sqlitecommand); return(CollectionConstructor(reader)); }
public void Write(string loggingLevel, LoggingTypeModel.LogCategory logCategory, string error, DateTime dateTime) { var sqlError = new Error { LoggingLevel = loggingLevel, DateTimeUTC = dateTime, ErrorType = logCategory.ToString(), Message = error }; _context.Errors.Add(sqlError); _context.SaveChanges(); }
/// <summary> /// Returns all Logged Errors by given Log Category Type. Not available if using the TextFile logger. /// </summary> /// <param name="logCategory"></param> /// <returns>IReadOnlyCollection</returns> public static IReadOnlyCollection <Error> Read(LoggingTypeModel.LogCategory logCategory) { var log = LogReader.ReadSpecificCategory(logCategory); return(log); }
public IReadOnlyCollection <Error> ReadSpecificCategory(LoggingTypeModel.LogCategory category) { throw new NotImplementedException(); }
public void WriteToErrorLog(string loggingLevel, LoggingTypeModel.LogCategory logCategory, string error, DateTime dateTime) { ExecuteSqLiteNonQuery($"INSERT INTO Error VALUES(NULL,'{loggingLevel}','{logCategory}','{error}','{dateTime:yyyy-MM-dd HH:mm:ss}')"); }