citty icon indicating copy to clipboard operation
citty copied to clipboard

Pluggable Logger

Open antfu opened this issue 10 months ago • 1 comments

Describe the feature

I want to use the command programmically by calling runCommand and get the output (to feedback to LLM). Currently nuxi uses a global singleton logger and not swappable (https://github.com/nuxt/cli/blob/692e6a97f673985de376489aa82854b88435f4cf/packages/nuxi/src/utils/logger.ts#L4), I would wish a standardized logger in city, and a logger option in runCommand to override the default logger for us to grab the information (or provide different rendering).

Additional information

  • [x] Would you be willing to help implement this feature?

antfu avatar Mar 14 '25 04:03 antfu

This is a good idea. I think we can support a "console-like" interface as logger option (defaulting to console and can be swapped with consola or disabled with false).

This also allows next major of city to also drop direct consola dependency.

pi0 avatar Mar 14 '25 09:03 pi0