Skip to main content
Vuetify0 is now in beta!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

useLogger API

API reference for the useLogger composable.

Explore these related pages for additional context and usage patterns.

PageCategory
useLoggerPlugins
PluginsFundamentals

Functions

createLogger

(options?: LoggerOptions) => LoggerContext

Creates a new logger instance.

useLogger

(scope?: string | undefined) => LoggerContext

Consumes the application logger provided by `createLoggerPlugin`. Call with no argument to use the configured logger as-is. Pass a scope key to get a logger that prefixes every message with a `[scope]` segment after the plugin prefix — useful for telling apart output from composables that share the app-level logger. A scoped logger shares the underlying logger's level, enabled state, and adapter; only the message prefix differs. A blank scope is treated as no scope.

createLoggerContext

<_E>(_options?: LoggerContextOptions | undefined) => ContextTrinity<_E>

createLoggerPlugin

(_options?: LoggerContextOptions | undefined) => Plugin

Options

adapter

LoggerAdapter | undefined

level

LogLevel | undefined

prefix

string | undefined

enabled

boolean | undefined

Methods

debug

(message: string, ...args: unknown[]) => void

info

(message: string, ...args: unknown[]) => void

warn

(message: string, ...args: unknown[]) => void

error

(message: string, ...args: unknown[]) => void

trace

(message: string, ...args: unknown[]) => void

fatal

(message: string, ...args: unknown[]) => void

level

(level: LogLevel) => void

current

() => LogLevel

enabled

() => boolean

enable

() => void

disable

() => void
Was this page helpful?

Ctrl+/