Skip to content

[kit] useLogger tag not working #32434

@davidstackio

Description

@davidstackio

Environment

  • Operating System: Windows_NT
  • Node Version: v22.15.0
  • Nuxt Version: 3.17.5
  • CLI Version: 3.25.1
  • Nitro Version: 2.11.12
  • Package Manager: npm@11.4.2
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

From the docs it looks like adding a tag parameter is supposed to add a suffix to the consola log output. However, it doesn't seem to be working.

const logger = useLogger('Test')
logger.warn('Hello world.')

Gives this output:

WARN  Hello world. 

I was expecting this:

WARN  [Test] Hello world. 

Edit: Stackblitz example
Reproduction with local nuxt module, but it happens for npm published modules too:
https://stackblitz.com/edit/github-b22s9xpu?file=modules%2Fapp%2Findex.ts

Describe the bug

Incorrect console logging.

Additional context

Sidenote: the docs say suffix, but it should probably say prefix.

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions