Pino Adapter
ThePinoLoggerAdapter integrates Pino, a high-performance structured logger, with Vuetify Zero’s useLogger composable.
Import
Installation
Install Pino as a peer dependency:Basic Usage
Using in Components
Structured Logging
Pino excels at structured logging with metadata:Log Levels
Pino Configuration
Browser Configuration
Node.js Configuration
Child Loggers
Metadata Formatting
The adapter formats arguments for Pino:Integration with pino-pretty
Remote Logging
TypeScript
Error Handling
The adapter requires a valid Pino instance:Environment-Specific Config
Benchmarks
Pino is one of the fastest Node.js loggers:
- ~30-50% faster than Winston
- ~10x faster than Bunyan
- Minimal overhead in production builds
Production Best Practices
Comparison with Other Adapters
| Feature | PinoAdapter | ConsolaAdapter | V0Adapter |
|---|---|---|---|
| Performance | Excellent | Good | Good |
| Structured logs | Yes | Yes | No |
| Browser support | Yes | Yes | Yes |
| Node.js support | Yes | Yes | Yes |
| Pretty output | Via pino-pretty | Built-in | Built-in |
| Remote logging | Yes | Via reporters | No |
| Best for | Production | Development | Development |
API Reference
Constructor
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pinoInstance | Logger | Yes | Pino logger instance |
Methods
| Method | Description |
|---|---|
debug(message, ...args) | Log debug with metadata |
info(message, ...args) | Log info with metadata |
warn(message, ...args) | Log warning with metadata |
error(message, ...args) | Log error with metadata |
trace(message, ...args) | Log trace with metadata |
fatal(message, ...args) | Log fatal with metadata |
Metadata Format
See Also
- Consola Adapter - Consola logger integration
- V0 Adapter - Built-in console logger
- useLogger - Logger composable
- Pino Documentation - Official Pino docs