unplugin / unplugin-turbo-console

🚀 Improve the Developer Experience of console
https://utc.yuy1n.io
MIT License
525 stars 12 forks source link

Prefix/suffix support for console methods: warn, info, error. #19

Closed andretchen0 closed 9 months ago

andretchen0 commented 9 months ago

Clear and concise description of the problem

As a developer using Unplugin I want prefix/suffix support for:

... so that I can use e.g., console.warn with the same prefix/suffix as console.log.

I'm working on a library and prefixing/suffixing console messages provides users of the library a clear, consistent indication that my library is generating the message.

Suggested solution

The Rollup strip() plugin optionally matches against any console methods and removes them.

That might serve as a starting point.

Alternative

No response

Additional context

Here's a StackBlitz showing only console.log getting prefix/suffix.

Console after clicking "Print Vue":

Screenshot 2024-02-08 at 00 13 10

Validations

stackblitz[bot] commented 9 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

yuyinws commented 9 months ago

This feature was released on https://github.com/unplugin/unplugin-turbo-console/releases/tag/v1.3.0

I'm glad to see that you want to integrate this plugin in tres. If you encounter any problems during this process, feel free to discuss with me.

andretchen0 commented 9 months ago

@yuyinws

Thank you!