Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(compiler): add debug statements for file watching
this commit is a follow up to #4146. when debugging the file watcher, it's valuable to know what files have been perceived as added/updated/etc. for #4146, we created dev-builds with additional logging statements to help diagnose the issue. in this commit, we add more refined debugging statements that attempt to balance providing useful information while not spamming the output with logging statements. when starting a dev server, the version of stencil has been added to the `[LOCAL DEV]`. starting with #4098, stencil has useful information in both dev and prod builds of the project that can is used here. this was also added to avoid a call to stencil's info task - most of the information from the info task is already provided in the output of starting of the dev server. by adding only the version here, we avoid redundant logging statements. the watch build task has been updated to log the files changed (added, updated, deleted, written). these statements can get slightly verbose, with at least one line per category per rebuild. however, this information was immensely helpful in #4146, and was deemed worth the extra output. the output is only provided when the logging level of the stencil logger is set to "debug", and won't be enabled for normal runs of the compiler. similar to the watch build task, additional debug-only logging was added to the node-sys watch file-related functions. debug statements in this file are not guarded with a conditional statement, as we do not have any guarantees/information around the logging level that has been set when a node-sys instance is created. in order to log correctly, an optional logger (optional as to not break the contract of this public api) has been added to the creation of node-sys. should one not be provided, debug logging will not apply.
- Loading branch information