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 one's kind of out of left field, but since I already implemented it locally and find it pretty useful when debugging my spacehammer code without distractions, I figured I'd submit a PR and see if it was something you'd find potentially worth merging 馃槈. No harm if you close this in the event I'm the only one who finds it useful! Also, let me know if the impl + config field/format looks good or if you'd prefer something different. Thanks!
Usecase
There are times I've found troubleshooting things I do with my config a little unwieldy due to the log noise generated by the
modal.fnl
/apps.fnl
debug logs. Since hammerspoon doesn't do anything special with the logger ID's in terms of managing id -> instance centrally, making each namespaced logger configurable would have required either exporting them each from their relevant modules or storing them in a container.To simplify things, wrote a small state container for any instantiated loggers in
lib/utils.fnl
; just a weak-valued table for storing logger instances by ID and a function that either fetches an existing logger by name or instantiates and stores a new one, setting log level if provided.I then proceeded to add support for a
log-levels
field in config, which is iterated at startup incore.fnl
to override log levels: