Closed CryptArchy closed 7 years ago
@CryptArchy Sorry, only just now looking at this. Thanks for contributing (with tests)!
This all looks good to me. If you could just update the docs to mention the function usage of level
, I'd be happy to merge it.
@rosston Thanks for the review! I totally forgot about updating the documentation, but I got you covered now! Let me know if anything else needs to be adjusted.
Perfect. Your clarifying comment on statusLevels
is a welcome bonus!
Released in 2.4.0. Thank you @CryptArchy!
Allow
options.level
to be a function for dynamic level setting.A project I am working on requires the ability to dynamically set the log level based on deeper inspection of the request and response. I added unit tests based on the existing ones, and everything is passing. I tried to set sane defaults and checks that should preserve the existing behavior of the middleware with
options.level
set to a string or object. Only setting it to a function should behave differently, and that wasn't a valid option before.