ILogger.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  1. /** Indicates the severity of a log message.
  2. *
  3. * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.
  4. */
  5. export declare enum LogLevel {
  6. /** Log level for very low severity diagnostic messages. */
  7. Trace = 0,
  8. /** Log level for low severity diagnostic messages. */
  9. Debug = 1,
  10. /** Log level for informational diagnostic messages. */
  11. Information = 2,
  12. /** Log level for diagnostic messages that indicate a non-fatal problem. */
  13. Warning = 3,
  14. /** Log level for diagnostic messages that indicate a failure in the current operation. */
  15. Error = 4,
  16. /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */
  17. Critical = 5,
  18. /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */
  19. None = 6
  20. }
  21. /** An abstraction that provides a sink for diagnostic messages. */
  22. export interface ILogger {
  23. /** Called by the framework to emit a diagnostic message.
  24. *
  25. * @param {LogLevel} logLevel The severity level of the message.
  26. * @param {string} message The message.
  27. */
  28. log(logLevel: LogLevel, message: string): void;
  29. }