V0 Adapter (Vuetify0LoggerAdapter)
TheVuetify0LoggerAdapter is the default console-based logger adapter for Vuetify Zero. It provides formatted, colorized console output for development and production environments.
Import
Basic Usage
The
Vuetify0LoggerAdapter is the default adapter when no adapter is specified:Using in Components
Log Levels
Configuration Options
Custom Prefix
Disable Colors
Disable Timestamps
Output Format
Browser
Node.js
Color Scheme
In browser environments, logs are colorized:| Level | Color | Hex |
|---|---|---|
trace | Gray | #64748b |
debug | Blue | #3b82f6 |
info | Green | #10b981 |
warn | Orange | #f59e0b |
error | Red | #ef4444 |
fatal | Bold Red | #dc2626 |
Timestamp Format
Browser
Node.js
Environment-Specific Configuration
Multiple Loggers
SSR Support
The adapter automatically adapts to server-side rendering:Logging with Arguments
TypeScript
Performance
The
Vuetify0LoggerAdapter is lightweight and optimized for development:- Minimal overhead - Direct console API calls
- No dependencies - Pure JavaScript implementation
- Browser-optimized - Uses console styling APIs
- SSR-safe - Adapts to Node.js and browser environments
Comparison with Other Adapters
| Feature | V0Adapter | ConsolaAdapter | PinoAdapter |
|---|---|---|---|
| Setup | Zero config | Requires Consola | Requires Pino |
| Colors | Built-in | Built-in | Via pino-pretty |
| Timestamps | Built-in | Via config | Via config |
| Structured logs | No | Yes | Yes |
| Performance | Good | Good | Excellent |
| Best for | Development | Development | Production |
API Reference
Constructor
Options
| Option | Type | Default | Description |
|---|---|---|---|
prefix | string | 'v0' | Log message prefix |
colors | boolean | true | Enable color formatting |
timestamps | boolean | true | Show timestamps |
Methods
| Method | Description |
|---|---|
debug(message, ...args) | Log debug message |
info(message, ...args) | Log info message |
warn(message, ...args) | Log warning message |
error(message, ...args) | Log error message |
trace(message, ...args) | Log trace message |
fatal(message, ...args) | Log fatal message |
When to Use
V0 Adapter
Development
Quick setup, formatted console output
Consola Adapter
Development
Fancy formatting, custom reporters
Pino Adapter
Production
High performance, structured logging
See Also
- Consola Adapter - Consola logger integration
- Pino Adapter - Pino structured logging
- useLogger - Logger composable