Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@docusaurus/logger
Advanced tools
An encapsulated logger for semantically formatting console messages.
@docusaurus/logger is a logging utility designed for use with Docusaurus, a popular static site generator. It provides a simple and consistent way to log messages with different levels of severity, such as info, warn, error, and success. The package is useful for developers who need to output logs during the build process or while running scripts related to Docusaurus projects.
Info Logging
Logs an informational message. This is useful for general-purpose logging to inform the user about the progress or state of the application.
const logger = require('@docusaurus/logger');
logger.info('This is an info message');
Warning Logging
Logs a warning message. This is useful for indicating potential issues that are not critical but should be noted.
const logger = require('@docusaurus/logger');
logger.warn('This is a warning message');
Error Logging
Logs an error message. This is useful for reporting errors that occur during the execution of the application.
const logger = require('@docusaurus/logger');
logger.error('This is an error message');
Success Logging
Logs a success message. This is useful for indicating successful completion of tasks or operations.
const logger = require('@docusaurus/logger');
logger.success('This is a success message');
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP). It is more feature-rich compared to @docusaurus/logger and is suitable for more complex logging requirements.
Bunyan is a simple and fast JSON logging library for Node.js services. It provides a structured logging approach, which can be more powerful for analyzing logs compared to the simpler text-based logging of @docusaurus/logger.
Pino is a low-overhead logging library for Node.js that focuses on performance. It is faster than many other logging libraries, including @docusaurus/logger, and is suitable for high-performance applications.
@docusaurus/logger
An encapsulated logger for semantically formatting console messages.
It exports a single object as default export: logger
. logger
has the following properties:
picocolors
. Note that their implementations are not guaranteed. You should only care about their semantics.
path
: formats a file path or URL.id
: formats an identifier.code
: formats a code snippet.subdue
: subdues the text.num
: formats a number.interpolate
function. It is a template literal tag.console.log
) or template literal tags.
info
: prints information.warn
: prints a warning that should be payed attention to.error
: prints an error (not necessarily halting the program) that signals significant problems.success
: prints a success message.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:
logger.info`Hello name=${name}! You have number=${money} dollars. Here are the ${
items.length > 1 ? 'items' : 'item'
} on the shelf: ${items}
To buy anything, enter code=${'buy x'} where code=${'x'} is the item's name; to quit, press code=${'Ctrl + C'}.`;
An embedded expression is optionally preceded by a flag in the form %[a-z]+
(a percentage sign followed by a few lowercase letters). If it's not preceded by any flag, it's printed out as-is. Otherwise, it's formatted with one of the formatters:
path=
: path
name=
: id
code=
: code
subdue=
: subdue
number=
: num
If the expression is an array, it's formatted by `\n- ${array.join('\n- ')}\n`
(note it automatically gets a leading line end). Each member is formatted by itself and the bullet is not formatted. So you would see the above message printed as:
2.0.0-beta.16 (2022-02-25)
docusaurus-logger
, docusaurus-module-type-aliases
, docusaurus-plugin-debug
, docusaurus-plugin-pwa
, docusaurus-theme-classic
, docusaurus-theme-search-algolia
, docusaurus-types
, docusaurus
create-docusaurus
docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-theme-search-algolia
docusaurus-plugin-content-docs
, docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-utils
docusaurus-plugin-content-docs
docusaurus-plugin-content-blog
docusaurus-plugin-content-blog
, docusaurus-theme-classic
create-docusaurus
, docusaurus-mdx-loader
, docusaurus-migrate
, docusaurus-plugin-client-redirects
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-debug
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-plugin-sitemap
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-live-codeblock
, docusaurus-theme-search-algolia
, docusaurus-theme-translations
, docusaurus-utils
, docusaurus
, stylelint-copyright
docusaurus-mdx-loader
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-types
docusaurus-types
, docusaurus-utils-validation
, docusaurus
docusaurus-theme-classic
, docusaurus-theme-search-algolia
docusaurus-module-type-aliases
, docusaurus-theme-common
, docusaurus
docusaurus-theme-common
docusaurus-module-type-aliases
, docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-plugin-content-docs
docusaurus-mdx-loader
docusaurus
docusaurus-theme-classic
docusaurus-utils
docusaurus-plugin-content-docs
, docusaurus-theme-classic
docusaurus-mdx-loader
, docusaurus-migrate
, docusaurus-plugin-client-redirects
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-theme-common
, docusaurus-theme-search-algolia
, docusaurus-utils
, docusaurus
, lqip-loader
create-docusaurus
docusaurus-plugin-content-docs
docusaurus-module-type-aliases
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-theme-classic
, docusaurus
docusaurus-theme-translations
docusaurus-theme-classic
, docusaurus-theme-translations
create-docusaurus
, docusaurus-theme-classic
docusaurus-theme-classic
docusaurus
docusaurus-utils-validation
docusaurus-mdx-loader
, docusaurus-utils
, lqip-loader
create-docusaurus
, docusaurus-mdx-loader
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-debug
, docusaurus-plugin-google-analytics
, docusaurus-plugin-google-gtag
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-plugin-sitemap
, docusaurus-preset-classic
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-search-algolia
, docusaurus-utils-validation
, docusaurus-utils
docusaurus-mdx-loader
docusaurus-theme-classic
, docusaurus-theme-common
docusaurus-plugin-content-docs
, docusaurus-theme-common
, docusaurus-theme-search-algolia
, docusaurus-types
, docusaurus-utils
, docusaurus
docusaurus-mdx-loader
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-debug
, docusaurus-plugin-google-analytics
, docusaurus-plugin-google-gtag
, docusaurus-plugin-sitemap
, docusaurus-preset-classic
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-search-algolia
, docusaurus-utils-validation
, docusaurus-utils
docusaurus-theme-classic
, docusaurus-theme-search-algolia
, docusaurus-theme-translations
docusaurus-preset-classic
docusaurus-theme-classic
docusaurus-migrate
docusaurus-plugin-content-docs
, docusaurus-theme-classic
docusaurus-module-type-aliases
, docusaurus-types
, docusaurus
docusaurus-module-type-aliases
docusaurus-plugin-client-redirects
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-search-algolia
, docusaurus-theme-translations
, docusaurus-utils
, docusaurus
, lqip-loader
create-docusaurus
, docusaurus-logger
, docusaurus-migrate
, docusaurus
docusaurus-module-type-aliases
, docusaurus-theme-common
, docusaurus
docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-theme-classic
docusaurus-plugin-pwa
, docusaurus-theme-classic
docusaurus-module-type-aliases
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-live-codeblock
, docusaurus-theme-translations
, docusaurus-utils-validation
, docusaurus-utils
, docusaurus
docusaurus-theme-live-codeblock
, docusaurus-theme-search-algolia
docusaurus-migrate
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-theme-common
, docusaurus-utils
, docusaurus
, lqip-loader
docusaurus-migrate
, docusaurus-plugin-content-docs
, docusaurus
create-docusaurus
, docusaurus-cssnano-preset
, docusaurus-logger
, docusaurus-mdx-loader
, docusaurus-migrate
, docusaurus-module-type-aliases
, docusaurus-plugin-client-redirects
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-plugin-content-pages
, docusaurus-plugin-debug
, docusaurus-plugin-google-analytics
, docusaurus-plugin-google-gtag
, docusaurus-plugin-ideal-image
, docusaurus-plugin-pwa
, docusaurus-remark-plugin-npm2yarn
, docusaurus-theme-classic
, docusaurus-theme-common
, docusaurus-theme-search-algolia
, docusaurus-theme-translations
, docusaurus-types
, docusaurus-utils-common
, docusaurus-utils-validation
, docusaurus-utils
, docusaurus
, stylelint-copyright
docusaurus-types
, docusaurus
create-docusaurus
, docusaurus-utils
docusaurus-migrate
, docusaurus-theme-common
docusaurus-mdx-loader
, docusaurus-remark-plugin-npm2yarn
, docusaurus
create-docusaurus
, docusaurus-mdx-loader
, docusaurus-migrate
, docusaurus-plugin-content-blog
, docusaurus-plugin-content-docs
, docusaurus-theme-search-algolia
, docusaurus-theme-translations
, docusaurus-utils
, docusaurus
FAQs
An encapsulated logger for semantically formatting console messages.
The npm package @docusaurus/logger receives a total of 207,270 weekly downloads. As such, @docusaurus/logger popularity was classified as popular.
We found that @docusaurus/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.