Skip to content

Log Levels

Frogger uses consola under the hood, so it shares consola's numeric log levels. Every log carries a numeric lvl and a string type.

Level (lvl)Types (type)Method(s)
0fatal, errorlogger.fatal(), logger.error()
1warnlogger.warn()
2loglogger.log()
3info, success, fail, ready, startlogger.info(), logger.success(), …
4debuglogger.debug()
5tracelogger.trace()
-999silentlogger.silent()
999verboselogger.verbose()

INFO

Frogger does not support consola's box level.

Every method has the same signature — a human-readable message, then optional structured context:

ts
logger.error('payment declined', { orderId, code })
logger.success('order shipped', { orderId })
logger.debug('cache miss', { key })

Dynamic levels — logLevel()

When the level isn't known until runtime, use logLevel(type, msg, ctx) with the type string:

ts
logger.logLevel('error', 'this is an error at level 0')
logger.logLevel('success', 'this is a success at level 3', { orderId })

It also accepts a reactive ref for the level, which is handy when the severity is data-driven:

ts
const level = ref<'info' | 'warn' | 'error'>('info')

logger.logLevel(level, 'status update')
level.value = 'error'
logger.logLevel(level, 'status escalated') // now logged at level 0

See the Logger API reference for the full contract.