ILogger.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using GreenTree.Nachtragsmanagement.Core;
  2. using GreenTree.Nachtragsmanagement.Core.Domain.Logging;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace GreenTree.Nachtragsmanagement.Services.Logging
  9. {
  10. public interface ILogger
  11. {
  12. /// <summary>
  13. /// Determines whether a log level is enabled
  14. /// </summary>
  15. /// <param name="level">Log level</param>
  16. bool IsEnabled(LogLevel level);
  17. /// <summary>
  18. /// Deletes a log item
  19. /// </summary>
  20. /// <param name="log">Log item</param>
  21. void DeleteLog(Log log);
  22. /// <summary>
  23. /// Clears a log
  24. /// </summary>
  25. void ClearLog();
  26. /// <summary>
  27. /// Gets all log items
  28. /// </summary>
  29. /// <returns>Log item collection</returns>
  30. IList<Log> GetAllLogs();
  31. /// <summary>
  32. /// Gets a log item
  33. /// </summary>
  34. /// <param name="logId">Log item identifier</param>
  35. /// <returns>Log item</returns>
  36. Log GetLogById(int logId);
  37. /// <summary>
  38. /// Get log items by identifiers
  39. /// </summary>
  40. /// <param name="logIds">Log item identifiers</param>
  41. /// <returns>Log items</returns>
  42. IList<Log> GetLogByIds(int[] logIds);
  43. /// <summary>
  44. /// Inserts a log item
  45. /// </summary>
  46. /// <param name="logLevel">Log level</param>
  47. /// <param name="shortMessage">The short message</param>
  48. /// <param name="fullMessage">The full message</param>
  49. /// <param name="user">The user to associate log record with</param>
  50. /// <returns>A log item</returns>
  51. Log InsertLog(LogLevel logLevel, string shortMessage, BaseEntity entity = null, string fullMessage = "",
  52. Core.Domain.User.User user = null);
  53. }
  54. }