** Obsolete, this is moved to https://github.com/Microsoft/vscode-debugadapter-node/blob/master/adapter/src/loggingDebugSession.ts **
vscode-debug-logger
This library provides easy logging for VS Code debug adapters. It has a few features that any debug adapter needs:
- Logs to
console.log
only when running in server mode. Debug adapters communicate with the client over stdin/out during normal operation, and usingconsole.log
will disrupt that stream. - Produces
OutputEvent
s with the propercategory
to display logs in the user's debug console. - A debug adapter doesn't get the user's launch config settings until the launch/attach events are received, so this library queues events received until that time and flushes them when possible.
- Writes logs to a file.
- Truncates very long messages that can hang VS Code.
Examples
Consider this all temporary - someday I'll rewrite it to use the winston logging library, or something else.
; ;;
In other files, you can simply import logger again - you never need to pass a logging object around.