logger.d.ts 693 B

1234567891011121314151617181920212223
  1. import { entityKind } from "./entity.js";
  2. export interface Logger {
  3. logQuery(query: string, params: unknown[]): void;
  4. }
  5. export interface LogWriter {
  6. write(message: string): void;
  7. }
  8. export declare class ConsoleLogWriter implements LogWriter {
  9. static readonly [entityKind]: string;
  10. write(message: string): void;
  11. }
  12. export declare class DefaultLogger implements Logger {
  13. static readonly [entityKind]: string;
  14. readonly writer: LogWriter;
  15. constructor(config?: {
  16. writer: LogWriter;
  17. });
  18. logQuery(query: string, params: unknown[]): void;
  19. }
  20. export declare class NoopLogger implements Logger {
  21. static readonly [entityKind]: string;
  22. logQuery(): void;
  23. }