import debug , { IDebugger } from "debug" ; type Message = string ; export interface Logger { trace ( message ) : void ; debug ( message ) : void ; info ( message ) : void ; warn ( message ) : void ; error ( message ) : void ; } class DebugLogger implements Logger { private readonly logger : IDebugger ; constructor ( namespace ) { this . logger = debug ( namespace ) ; } public trace ( message ) { this . logger ( `TRACE ${ message }` ) ; } public debug ( message ) { this . logger ( `DEBUG ${ message }` ) ; } public info ( message ) { this . logger ( `INFO  ${ message }` ) ; } public warn ( message ) { this . logger ( `WARN  ${ message }` ) ; } public error ( message ) { this . logger ( `ERROR ${ message }` ) ; } } export class FakeLogger implements Logger { public readonly traceLogs : Message [ ] = [ ] ; public readonly debugLogs : Message [ ] = [ ] ; public readonly infoLogs : Message [ ] = [ ] ; public readonly warnLogs : Message [ ] = [ ] ; public readonly errorLogs : Message [ ] = [ ] ; public trace ( message ) { this . traceLogs . push ( message ) ; } public debug ( message ) { this . debugLogs . push ( message ) ; } public info ( message ) { this . infoLogs . push ( message ) ; } public warn ( message ) { this . warnLogs . push ( message ) ; } public error ( message ) { this . errorLogs . push ( message ) ; } } export const log = new DebugLogger ( "testcontainers" ) ; export const containerLog = new DebugLogger ( "testcontainers:containers" ) ;