Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for (internal) debug logging output #289

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Nov 6, 2024

Overview

The changes provided by this commit were initially intended to provide a minimal abstraction to support toggling the size of plugin output off/on as needed for troubleshooting. From there the scope widened as further iteration showed that it could be useful to add debug logging support (internally for now) to the library as a whole.

To support toggling on/off specific debug log activity, debug log output is currently split into two categories:

  • debug logging of actions
  • debug logging of plugin output size

The intent of these changes is to provide a way to easily toggle on/off the internal workings of this library. If client code does not enable debug logging, the result should be this library working just as it did before.

The current implementation is subject to change as real world testing is applied and feedback collected.

Changes

  • allow toggling debug logging output on/off
  • allow toggling specific debug logging output on/off
    • e.g., allow all debug messages except for general plugin activity
    • e.g., allow only debug messages for plugin output size calculations
  • support setting custom debug logging output target
    • e.g., redirect debug log messages to a target file instead of stderr (the default debug log target)
  • add test coverage for new behavior
  • update documentation for (internal) debug logging
    • update README and add example tests to illustrate new behavior
  • log early exit behavior for section handlers
  • add p.logAction calls to early exit points within each applicable section handler to make troubleshooting unexpected results involving empty input easier.

References

@atc0005 atc0005 added enhancement New feature or request tests output/logging plugin debug logging output intended for troubleshooting purposes labels Nov 6, 2024
@atc0005 atc0005 added this to the v0.17.0 milestone Nov 6, 2024
@atc0005 atc0005 self-assigned this Nov 6, 2024
@atc0005 atc0005 force-pushed the i271-add-support-for-debug-logging-output branch from f3710cc to 74a99ad Compare November 6, 2024 13:44
OVERVIEW

The changes provided by this commit were initially intended to provide
a minimal abstraction to support toggling the size of plugin output
off/on as needed for troubleshooting. From there the scope widened as
further iteration showed that it could be useful to add debug logging
support (internally for now) to the library as a whole.

To support toggling on/off specific debug log activity, debug log
output is currently split into two categories:

- debug logging of actions
- debug logging of plugin output size

The intent of these changes is to provide a way to easily toggle
on/off the internal workings of this library. If client code does not
enable debug logging, the result should be this library working just
as it did before.

The current implementation is subject to change as real world testing
is applied and feedback collected.

CHANGES

- allow toggling debug logging output on/off
- allow toggling specific debug logging output on/off
  - e.g., allow all debug messages except for general plugin activity
  - e.g., allow only debug messages for plugin output size calculations
- support setting custom debug logging output target
  - e.g., redirect debug log messages to a target file instead of
    stderr (the default debug log target)
- add test coverage for new behavior
- update documentation for (internal) debug logging
  - update README and add example tests to illustrate new behavior
-  log early exit behavior for section handlers
  - add `p.logAction` calls to early exit points within each
    applicable section handler to make troubleshooting unexpected
    results involving empty input easier

REFERENCES

- refs GH-264
- refs GH-271

Log early exit behavior for section handlers

Add `p.logAction` calls to early exit points within each
applicable section handler to make troubleshooting unexpected
results involving empty input easier.

refs GH-271
@atc0005 atc0005 force-pushed the i271-add-support-for-debug-logging-output branch from 2cf8726 to 29aab3f Compare November 6, 2024 13:48
@atc0005 atc0005 merged commit 12c2ed5 into master Nov 6, 2024
30 of 31 checks passed
@atc0005 atc0005 deleted the i271-add-support-for-debug-logging-output branch November 6, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request output/logging plugin debug logging output intended for troubleshooting purposes tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for debug logging output Add support for emitting size of plugin output to stderr
1 participant