docs: add section on logger usage for plugins (#2139)

This commit is contained in:
Justin Poehnelt 2021-09-21 16:52:17 -06:00 committed by GitHub
parent eb32d79ce4
commit 0ce4846b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,6 +237,20 @@ if (env.GITHUB_TOKEN) {
//...
}
```
## Logger
Use `context.logger` to provide debug logging in the plugin.
```js
const { logger } = context;
logger.log('Some message from plugin.').
```
The above usage yields the following where `PLUGIN_PACKAGE_NAME` is automatically inferred.
```
[3:24:04 PM] [semantic-release] [PLUGIN_PACKAGE_NAME] Some message from plugin.
```
## Execution order