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

Print information on STDERR if --json has been selected #84

Merged

Conversation

matsduf
Copy link
Contributor

@matsduf matsduf commented Aug 9, 2018

Print information on selected config or policy to STDERR if --json has been selected. Keep STDOUT for other printing. Especially for normal printing STDERR would be confusing. This solves issue #77

@@ -292,12 +292,14 @@ sub run {
}

if ( $self->policy ) {
say __( "Loading policy from " ) . $self->policy . '.' if not ($self->dump_config or $self->dump_policy);
say __( "Loading policy from " ) . $self->policy . '.' if not ($self->dump_config or $self->dump_policy or $self->json);
warn __( "Loading policy from " ) . $self->policy . ".\n" if $self->json;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't the diagnostic printed to STDERR for the dump_policy mode? To me this diagnostic makes more sense in that mode than in any other mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot answer why. That is an old decision. I will update.

* Added message to STDERR of loaded policy if policy file has been selected.
* Added message to STDERR of loaded config if config file has been selected.
@matsduf matsduf merged commit 4e29dec into zonemaster:develop Aug 17, 2018
@matsduf matsduf deleted the resolve-issue-77-print-diagnostics branch August 17, 2018 09:25
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

Successfully merging this pull request may close these issues.

2 participants