Export the logger for plugins
See original GitHub issueExport the logger for plugins
Environments
- Prettier Version: 1.19.1
- Running Prettier via: CLI
- Runtime: Node.js v10+
- Operating System: Windows, Linux, macOS
Steps to reproduce
- Just write a plugin ^^ (like
@prettier/plugin-pug
) - Try to access the logger so that the CLI option
--loglevel
can take effect and can be used for the plugin - Also benefit from chalk cli coloring
Expected behavior
The logger can be used/accessed in a plugin
Actual behavior
I had to write a logger by myself
And this could not be managed by --loglevel
🙁
Old Issue
#3585 that was locked-due-to-inactivity
👎
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Advanced PBX Data Logger - Plugins - AGG Software
This data export module for Advanced PBX Data Logger is used for recording and saving the parsed data into SQL-compatible databases: Microsoft SQLServer,...
Read more >How to import and export WP Activity Log configuration settings
1. Click on WP Activity Log from the WordPress side menu · 2. Click on Settings from the WP Activity Log piano menu...
Read more >Logger Interface - webpack
Webpack logger is available to loaders and plugins. ... const PLUGIN_NAME = 'my-webpack-plugin'; export class MyWebpackPlugin { apply(compiler) { // you can ...
Read more >How To Export CRM Plugin Error Logs - Outreach Support
Access the Outreach Platform. · Access the CRM Plugin. · Click the Logs tab. · Click the Export button to the right of...
Read more >Log Export | WordPress.org
You can't export any logs from the Wordfence plugin. All you can do is to setup email alerts and also send an activity...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The thing is Prettier itself doesn’t have loggers. Its CLI does, but the CLI is a kind of separate thing. Think of it as of a separate package, which it (or a completely new CLI) should eventually become. It’s a Node program that uses Prettier API, whereas Prettier proper is an environment-independent library.
So even if we decide to support this use case, we can’t do it the way you did in your PR. The plugin helpers (
util-shared
) can’t use things likechalk
orprocess.stdout
. Pieces of the CLI code can’t leave the/cli
directory and can’t be used in other directories.Ok that’s a point I understand 😕