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

Add headers to every line of multiline log entries #113

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

mattias-p
Copy link
Member

@mattias-p mattias-p commented Aug 8, 2019

Add headers to all of the lines in --raw mode. To tell where new entries begin I added a marker character right after MODULE:TAG. The first line of an entry is marked with an extra SPACE character. The following lines are marked with a '>' character.

When you have headers on all lines you can filter the logs with better precision using grep.

Edit: I removed the reference to #111 as this PR solves a different problem.

@matsduf matsduf self-requested a review August 8, 2019 11:29
Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

Your "patch" does not change anything. There is no difference in output. When I investigate I find that it is line 407 that prints out the lines.

say $translator->translate_tag( $entry );

@mattias-p mattias-p requested a review from matsduf August 9, 2019 08:32
Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

--raw is documented to print raw messages instead of as human language. I feel that it is wrong that --raw should have other side effects on the output.

I also feel that the new output is problematic for ocular inspection and we need support for that too.

@matsduf matsduf added this to the v2019.3 milestone Oct 31, 2019
@matsduf matsduf modified the milestones: v2019.3, v2020.1 Nov 20, 2019
@mattias-p
Copy link
Member Author

@matsduf --raw is already prefixing some of the lines with headings. This change makes it so all lines are uniformly prefixed. I don't agree that it makes the output more difficult on the eye. In fact I argue the opposite. It also make the output more predictable to parse for machines. Please reconsider.

@matsduf
Copy link
Contributor

matsduf commented May 27, 2020

Please reconsider.

I will check your branch again to see how it looks like in different cases.

@matsduf matsduf modified the milestones: v2020.1, v2020.2 Sep 14, 2020
Rename variables, update whitespace, remove indirection through sprintf.
@mattias-p
Copy link
Member Author

I had to rework this PR because the output format of the --raw mode had change, but the effect of the PR is essentially the same.

Please re-review.

Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

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

I have no specific use case to test against, but it looks OK. The output format of "raw" should be documented in a different PR.

@mattias-p mattias-p merged commit d82d90e into zonemaster:develop Jan 13, 2021
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