asenchi / scrolls

Simple logging
MIT License
158 stars 26 forks source link

level output in messages is hardcoded to downgrade severity #83

Closed brphelps closed 3 years ago

brphelps commented 3 years ago

Calling .error() produces a result that has level set to "warning". It looks like this was an intentional change when it went in, so it should be preserved: https://github.com/asenchi/scrolls/commit/a5bd2281af7ad5a293e3f65316c06b776300a405

In our usage, we really want calls to .error() to produce a data stream that has a level of "error". (similar for the rest, we're looking for something we can easily correlate to the calling block).

I think this could be easily solved with the addition of a boolean that defaults to current behavior, but if overridden will just use the "matching" level for a given call. If this is an OK approach, I can PR the solution.

asenchi commented 3 years ago

Definitely, I like that approach a lot.