import * as vscode from "vscode" ; const CHANNEL_ID = "k3d" ; export interface ILogChannel { showOutput ( message , title ? ) : void ; appendLine ( message ) : void ; } class LogChannel implements ILogChannel { private readonly channel : vscode . OutputChannel = vscode . window . createOutputChannel ( CHANNEL_ID ) ; showOutput ( message , title ? ) { if ( title ) { const simplifiedTime = ( new Date ( ) ) . toISOString ( ) . replace ( /z|t/gi , ' ' ) . trim ( ) ; const hightlightingTitle = `[${ title } ${ simplifiedTime }]` ; this . appendLine ( hightlightingTitle ) ; } this . appendLine ( message ) ; } appendLine ( message ) { this . channel . appendLine ( message ) ; this . channel . show ( ) ; } } export const logChannel = new LogChannel ( ) ;