Handling mismatched log levels #1

Merged
merged 3 commits into from Apr 5, 2012

Conversation

Projects
None yet
2 participants
@karenetheridge
Contributor

karenetheridge commented Apr 5, 2012

Okay, after a lot of fiddling this is what I decided:

F-- it with making the code handle this. It would require mapping log levels twice just to go through the psgix.logger coderef. It's easier to simply do this:

my $logger = Log::Dispatch->new(...);
enable 'LogDispatch', logger => $logger;

enable 'Log::Contextual', logger => $logger;

...which would mean that code buried in the $app that does log_critical { $message }; doesn't go through psgix.logger at all, therefore nothing is being broken in the PSGI standard. Of course the $app is also free to do $env->{'psgix.logger'}->({level => 'fatal', message => $message}), if it wants to avoid knowledge of what type of logger is being used.

So, the patches are limited to doc updates. I've split the wording improvements out as a separate commit in case you want to reject the other one.

Sorry again for the confusion. :/

@miyagawa

This comment has been minimized.

Show comment
Hide comment
@miyagawa

miyagawa Apr 5, 2012

Owner

Ah I see, yes, there's a logger option supported just for this. i actually forgot about that and great you can make a good use of it.

Owner

miyagawa commented Apr 5, 2012

Ah I see, yes, there's a logger option supported just for this. i actually forgot about that and great you can make a good use of it.

miyagawa added a commit that referenced this pull request Apr 5, 2012

@miyagawa miyagawa merged commit 5f939ba into miyagawa:master Apr 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment