message.d.ts 723 B

123456789101112131415161718
  1. import { LogContext } from './context';
  2. interface LogMessage {
  3. context: LogContext;
  4. message: string;
  5. sequence: number;
  6. time: number;
  7. }
  8. declare type LogMessageFormatter = (msg: LogMessage) => string;
  9. declare type LogMessageTranslator = (msg: LogMessage) => LogMessage;
  10. interface LogFormattersMap {
  11. json: LogMessageFormatter;
  12. simple: LogMessageFormatter;
  13. [key: string]: LogMessageFormatter;
  14. }
  15. declare let LogFormatters: LogFormattersMap;
  16. declare const resetLogFormatters: () => void;
  17. declare const registerLogFormatter: (name: string, format: LogMessageFormatter) => void;
  18. export { LogMessage, LogMessageTranslator, LogMessageFormatter, LogFormatters, resetLogFormatters, registerLogFormatter, };