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

This commit is contained in:
Justin Poehnelt
2021-09-21 15:52:17 -07:00
committed by GitHub
parent eb32d79ce4
commit 0ce4846b68
+14
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