Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add fatal #44

Open
nigelhorne opened this issue Apr 10, 2017 · 5 comments
Open

Please add fatal #44

nigelhorne opened this issue Apr 10, 2017 · 5 comments

Comments

@nigelhorne
Copy link

Please add a 'fatal' method which should be the same as 'critical'. This would add compatibility with Log::Log4perl.

@nigelhorne
Copy link
Author

Also, would you please add 'warn' as well as 'warning'?

@preaction
Copy link
Contributor

The docs say that "We also allow 'warn' as a synonym for 'warning'" already, so if it's not working, that's a bug. As for compatibility with other logging systems, isn't that what Log::Any is for? If it's still desirable to put it in Log-Dispatch, then it'd probably be good to do the same mapping as it does (which is, yes, fatal => 'critical').

@autarch
Copy link
Member

autarch commented Apr 13, 2017

I think I agree with preaction that if you need compatibility between logging systems then Log::Any is the way to go.

@nigelhorne
Copy link
Author

This is for Log::WarnDie, so I don't see how that would help.

@preaction
Copy link
Contributor

The Log::WarnDie docs say "Any object that provides a warning, error and critical method, will operate with this module." This makes me think Log::WarnDie would already work with Log::Any::Adapter objects, which should all implement those three methods[1]. So you could use the existing Log::Any::Adapter::Dispatch module (which connects Log::Any and Log::Dispatch), and the corresponding Log::Any::Adapter::Log4perl adapter (the Log::WarnDie docs mention that Log4perl does not support critical, but Log::Any::Adapter::Log4perl does and maps it to fatal).

I think Log::Any is a better solution for Log::WarnDie: If you want to log to files or syslog or Mojolicious or other facilities, you don't need to take the middle step of using Log::Dispatch and setting up its output handles. You just directly configure the output adapters on the Log::WarnDie object.

If all else fails, a quick can() check on the Log::Dispatch/Log::Log4perl object would see which methods you have available to you so you can pick which of critical or fatal to use (unless you're planning on using both for different things, at which point I'd go with Log::Any).

[1]: People have been giving me maintainership of adapters left and right, so if any don't work with Log::WarnDie, I probably have the permissions needed to fix them.

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

No branches or pull requests

3 participants