Logging
Nuxt Kit provides a set of utilities to help you work with logging. These functions allow you to log messages with extra features. Nuxt provides a logger instance that you can use to log messages with extra features.useLogger
Returns a logger instance. It uses consola under the hood.
Type
Parameters
tag: A tag to suffix all log messages with, displayed on the right near the timestamp.
options: Consola configuration options.
Usage
Example with options
Available log methods
The logger instance provides the following methods:logger.info()- Log an info messagelogger.success()- Log a success messagelogger.warn()- Log a warning messagelogger.error()- Log an error messagelogger.debug()- Log a debug messagelogger.trace()- Log a trace messagelogger.log()- Log a generic message