new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

composables/logging

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

useLogger - get a logger instance

useLogger returns a logger instance powered by consola. It accepts an optional tag string that suffixes all log messages and an optional Partial<ConsolaOptions> for configuration. The signature is: function useLogger(tag?: string, options?: Partial<ConsolaOptions>): ConsolaInstance. The tag parameter is displayed on the right near the timestamp.

useLogger usage example in a Nuxt module

import { defineNuxtModule, useLogger } from '@nuxt/kit' export default defineNuxtModule({ setup (options, nuxt) { const logger = useLogger('my-module') logger.info('Hello from my module!') }, })

useLogger with ConsolaOptions example

import { defineNuxtModule, useLogger } from '@nuxt/kit' export default defineNuxtModule({ setup (options, nuxt) { const logger = useLogger('my-module', { level: options.quiet ? 0 : 3 }) logger.info('Hello from my module!') }, })

Give your agent this brain