diff --git a/packages/docusaurus-logger/README.md b/packages/docusaurus-logger/README.md index 5372474d484b..394c54ce3787 100644 --- a/packages/docusaurus-logger/README.md +++ b/packages/docusaurus-logger/README.md @@ -40,6 +40,8 @@ In addition, `warn` and `error` will color the **entire** message for better att The template literal tag evaluates the template and expressions embedded. `interpolate` returns a new string, while other logging functions prints it. Below is a typical usage: ```js +import logger from '@docusaurus/logger'; + logger.info`Hello name=${name}! You have number=${money} dollars. Here are the ${ items.length > 1 ? 'items' : 'item' } on the shelf: ${items} diff --git a/website/docs/api/misc/logger/logger.mdx b/website/docs/api/misc/logger/logger.mdx index 04800ed25b78..8ce3f5ac2925 100644 --- a/website/docs/api/misc/logger/logger.mdx +++ b/website/docs/api/misc/logger/logger.mdx @@ -49,6 +49,8 @@ In addition, `warn` and `error` will color the **entire** message for better att The template literal tag evaluates the template and expressions embedded. `interpolate` returns a new string, while other logging functions prints it. Below is a typical usage: ```js +import logger from '@docusaurus/logger'; + logger.info`Hello name=${name}! You have number=${money} dollars. Here are the ${ items.length > 1 ? 'items' : 'item' } on the shelf: ${items}