Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37: Refactor handling of logging and user messaging. r=Yatekii a=noppej `probe-rs` recently adopted the `tracing` crate for logging. This opened up the possibility to cleanup how logging was implemented in the VSCode extension and associated `probe-rs-debugger`. This PR will do the following: - As a maintenance task, update the extension dependencies, and bump the version number. - Add a `launch.json` setting to direct `probe-rs` logging to a JSON file, which can later be analyzed with [the log viewer](https://github.com/probe-rs/log-viewer). - Remove any `probe-rs` (RUST_LOG) logging from the data being reported in the VSCode debug console. It is currently interspersed with debug adapter logging, and although somewhat informative, it makes it less than useful when analyzing `probe-rs` specific issues. - Refactor the VSCode extension and `probe-rs-debugger` handling of MS DAP events and messages, to be more useful (objective opinion) to users of the extension. - `probe-rs-debugger` logging will happen according to these rules: 1. If the RUST_LOG environment variable is set, use it as a `LevelFilter` to configure a subscriber that logs to a file in the system's application data directory. 2. Irrespective of theRUST_LOG environment variable, configure a subscriber that will write with `LevelFilter::ERROR` to stderr (because these errors are picked up and reported to the user by the VSCode extension). **NOTE** This release requires changes to the `launch.json` files in user projects - The `consoleLog` property only supports one of three values `[Console, Info, Debug]` - The extension will now honour `env` properties, for example: ``` "env": { "RUST_LOG": "warn", "DEFMT_LOG": "debug" } ``` For testing, feel free to use the [extension binary](https://github.com/probe-rs/vscode/releases/tag/v0.4.1) Co-authored-by: JackN <noppej@hotmail.com>
- Loading branch information