import test from "ava" ; import type { LoggerFormat } from "../../Logger" ; import { LoggerPluginTerminal } from "../LoggerPluginTerminal" ; const namespace = "[logger][logger-plugin][logger-plugin-terminal]" ; test ( `${ namespace } - test logger context and format` , ava => { const protoConsole = console . log ; let testLogOutput ; console . log = ( log ) => { testLogOutput = log ; } ; const loggerPluginTerminal = new LoggerPluginTerminal < Context > ( ) ; const log = { timestamp : "time" , label : "test" , level : "info" , message : "xx" , payload : { test : 1 , } , } ; loggerPluginTerminal . output ( log ) ; ava . is ( testLogOutput , JSON . stringify ( log , null , 2 ) ) ; console . log = protoConsole ; type Context = { test : number ; } ; } ) ;