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

message handling in log_fatal is suboptimal #397

Open
karenetheridge opened this issue Dec 27, 2014 · 3 comments
Open

message handling in log_fatal is suboptimal #397

karenetheridge opened this issue Dec 27, 2014 · 3 comments

Comments

@karenetheridge
Copy link
Contributor

(I'm filing this as a Dist-Zilla issue instead of in Log::Dispatchouli with the presumption that the logger could be configured differently to make things come out better. I don't know for sure, though!)

Messages sent to log_fatal are printed twice, for example:

[@Author::ETHER/stale modules, release] Aborting release
[@Author::ETHER/stale modules, release] To remedy, do: cpanm Dist::Zilla::Plugin::CheckPrereqsIndexed
[@Author::ETHER/stale modules, release] Aborting release
[@Author::ETHER/stale modules, release] To remedy, do: cpanm Dist::Zilla::Plugin::CheckPrereqsIndexed at /Users/ether/.perlbrew/libs/20.1@std/lib/perl5/darwin-2level/Moose/Meta/Method/Delegation.pm line 110.

PromptIfStale is definitely only calling log_fatal once, but the message is printed twice, once via the logger and once via Carp::croak. I traced the culprit code to Log::Dispatchouli::log:

https://metacpan.org/source/RJBS/Log-Dispatchouli-2.012/lib/Log/Dispatchouli.pm#L298-308

@van-de-bugger
Copy link
Contributor

  1. It is a minor issue if message is sort, like 'Release aborted'. But it becomes ugly n case of multi-line message. For example, Mercurial::Check calls log_fatal with a list of not-yet-committed files, and the list is printed by dzil twice.
  2. If Mercurial::Check or ConfirmRelease aborts the release by calling log_fatal, there is no need to report source location where the process was aborted.

So, the second appearance of fatal message is ugly redundant.

@karenetheridge
Copy link
Contributor Author

cross-reference - https://rt.cpan.org/Ticket/Display.html?id=105191

@kentfredric
Copy link
Contributor

Still an issue in Dzil6. But I think this requires properly fixing in LD somewhere.

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

No branches or pull requests

3 participants