Skip to content

Commit

Permalink
Add watch logging (#9786)
Browse files Browse the repository at this point in the history
* Add watch loggging

* Add sample event

* Add null check
  • Loading branch information
mattcompiles authored Jun 11, 2024
1 parent 35e936a commit 78bf4a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/core/src/Parcel.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,18 @@ export default class Parcel {
resolvedOptions.watchDir,
async (err, events) => {
if (err) {
logger.verbose({
message: `File watch event error occured`,
meta: {err},
});
this.#watchEvents.emit({error: err});
return;
}

logger.verbose({
message: `File watch event emitted with ${events.length} events. Sample event: [${events[0]?.type}] ${events[0]?.path}`,
});

let isInvalid = await this.#requestTracker.respondToFSEvents(
events,
Number.POSITIVE_INFINITY,
Expand Down

0 comments on commit 78bf4a9

Please sign in to comment.