export type LoggingType = 'debug' | 'error' | 'warn' ; export type Logging = ( type : LoggingType , ... args : unknown [ ] ) => void ; export interface LoggingFactory { create : ( id : string ) => Logging ; } export const workspaceLogging = ( workspaceName , verbose ) : LoggingFactory => { const create = ( id ) : Logging => ( type , ... args ) : void => { const name = `[${ workspaceName }/${ id }]` ; if ( type === 'debug' ) { if ( verbose ) { console . log ( name , ... args ) ; } return ; } if ( type === 'warn' ) { console . warn ( name , ... args ) ; return ; } console . error ( name , ... args ) ; } ; return { create } ; } ;