Replies: 3 comments 2 replies
-
The goal of reporters is to abstract the event handling so multiple UIs can be built - e.g. terminal, browser, vscode extension, etc. Outsourcing logging to another library might make this more difficult. A custom reporter plugin could definitely implement some of the features you propose though, perhaps even using one of those libraries if it is helpful. You could listen for log events and store them wherever you want. What additional logs are you looking to add? I haven't really thought of Parcel like a typical long-running backend service where logs would need to be stored since it resets on each build so I'm curious what you're looking to learn. |
Beta Was this translation helpful? Give feedback.
-
Current issues that would be aided by extra logging getting added into the tool:
|
Beta Was this translation helpful? Give feedback.
-
We have since added logging to files in our production use-case. This is essential for production usage of this tool therefore it'd be great to add it to the core repository. I'm closing this as we won't be addressing this broadly soon. |
Beta Was this translation helpful? Give feedback.
-
Problem statement
Parcel could log more information to aid its developers in debugging issues such as cache corruption, performance issues etc.
In order to have more verbose logs, parcel should ideally:
Current state
Currently parcel logs are implemented via
@parcel/logger
. The logger itself does not write to any destination, but rather emit events. Within@parcel/core
,@parcel/core/src/ReporterRunner.js
will subscribe to logger events and forward them to all configured reporters.The CLI reporter at
@parcel/reporter-cli
will match logger events and print them to STDOUT and STDERR.Proposed state
I propose that parcel adds a dependency on popular logging libraries for node.js and rust.
These could be
pino
andtracing_subscriber
+tracing
. We would log to a temporary file and configure these libraries to rotate the output after a certain size is reached.We'd instrument throughout the codebase, verbose structured logs for operations like building of individual files or serialising data between threads; as much as we possibly can without impacting performance.
The reporter based logs, which are "user facing logs", can be kept with the current solution.
@parcel/logger
API would be modified to account for user-facing logs, which would be printed to STDOUT and be user-facing ; and internal logs, which would be written to a temporary directory for debugging purposes.Possibly, this would be split ; making
@parcel/logger
a different name; or importing the logging libraries directly where they are needed.Beta Was this translation helpful? Give feedback.
All reactions