tesla icon indicating copy to clipboard operation
tesla copied to clipboard

Documentation Issues: Logger Middleware

Open aselder opened this issue 5 years ago • 3 comments

I was running it to a situation where I set the log_level of a Logger middleware to always be :debug, but I was still seeing log output with the Logger log_level set to warn.

Looking at the code, it does something slightly different than was the documentation says.

If the request returns {:error, whatever}, the log level is always set to :error, the custom log level function is never called. The custom log level is only used when an {:ok, ...} is returned.

aselder avatar Apr 29 '20 17:04 aselder

Also, the docs don't mention that you can pass an atom instead of a function as the log_level option

aselder avatar Apr 29 '20 17:04 aselder

I'll see what I can do about putting together a PR.

aselder avatar Apr 29 '20 17:04 aselder

Hey @aselder, do you still want to give this a try? :)

teamon avatar Sep 10 '21 07:09 teamon