From 0ce4846b68ed35388c008f1bb5b2a994cc2ec354 Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Tue, 21 Sep 2021 16:52:17 -0600 Subject: [PATCH] docs: add section on logger usage for plugins (#2139) --- docs/developer-guide/plugin.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/developer-guide/plugin.md b/docs/developer-guide/plugin.md index cb98d7c8..041fb368 100644 --- a/docs/developer-guide/plugin.md +++ b/docs/developer-guide/plugin.md @@ -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