Conversation
5e00063 to
19a7900
Compare
This can be used to print events to stderr: [~cg/fsnotify](dbg)% FSNOTIFY_DEBUG=1 fsnotify watch /tmp/ >/dev/null FSNOTIFY_DEBUG: 11:34:23.633087586 256:IN_CREATE → "/tmp/a" FSNOTIFY_DEBUG: 11:34:23.633202319 4:IN_ATTRIB → "/tmp/a" FSNOTIFY_DEBUG: 11:34:26.782035307 256:IN_CREATE → "/tmp/b" FSNOTIFY_DEBUG: 11:34:26.782137248 4:IN_ATTRIB → "/tmp/b" FSNOTIFY_DEBUG: 11:34:28.989728764 512:IN_DELETE → "/tmp/a" FSNOTIFY_DEBUG: 11:34:30.356208544 2:IN_MODIFY → "/tmp/b" FSNOTIFY_DEBUG: 11:34:30.356272832 4:IN_ATTRIB → "/tmp/b" FSNOTIFY_DEBUG: 11:34:32.957233528 512:IN_DELETE → "/tmp/b" The internal.Debug() functions already existed; I sometimes added this manually during development. This makes it more broadly useful. Can be useful to debug some issues.
Closed
|
Would you mind if this were replaced with a logging interface, rather than directly printing to stderr? This would be nicer for applications that are using their own logging libraries. This can be done with a simple stdlog compatible interface, or a Go log/slog compatible interface. |
Member
Author
|
This is just to facilitate printing something so people reporting "I have a problem with some random program" can provide more information, similar to GODEBUG, the race detector, etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This can be used to print events to stderr:
The internal.Debug() functions already existed; I sometimes added this manually during development. This makes it more broadly useful. Can be useful to debug some issues.