vscode-basex/src/common/logger.ts
2022-06-07 16:29:12 +01:00

24 lines
No EOL
672 B
TypeScript

// debug messages
import { OutputChannel, window } from "vscode";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ver = require("@quodatum/xqlint").version;
const _channel:OutputChannel = window.createOutputChannel("BaseX");
function logdate(){
return (new Date()).toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " ");
}
export class channel {
static log(msg: string) :void{
_channel.appendLine("["+logdate()+"] "+msg)
}
static appendLine(msg: string) :void{
_channel.appendLine(msg)
}
static show() :void{
_channel.show
}
}
channel.log("started, XQLint version: "+ver);
_channel.show