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

AnyAgent - improved logging to easier find bugs similar to bsc#1030425 #120

Closed
wants to merge 2 commits into from

Conversation

lslezak
Copy link
Member

@lslezak lslezak commented Apr 20, 2017

This just increases the logging in the AnyAgent to easily find bugs similar to bsc#1030425.

Originally the parser silently aborted parsing without any trace in the log, debugging was then very tricky.

The Disadvantage

The increased logging on the other hand reports some false positives, e.g. the AnyAgent allows syntax like :Or(:Tuple(...), :Tuple()). Which means it's OK when the first Tuple does not match the line, but it will log no match anyway as it cannot see the logic above.

We could improve that logic, but IMHO that's waste of time as the AnyAgent is obsolete anyway and we should rather focus on using the new approach (Augeas).

So the question is: do we want this verbose logging at the price of the false positives? See the updated tests for some examples.

  • 3.2.3

if (tv.isNull())
{
if (optional)
y2milestone("Optional Tuple not found at line: '%s'", line);
Copy link
Member

Choose a reason for hiding this comment

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

better to use y2debug, as it can be quite often case

if (optional)
y2milestone("Optional Tuple not found at line: '%s'", line);
else
y2error("Tuple not found at line: '%s'", line);
Copy link
Member

Choose a reason for hiding this comment

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

in general seeing output include newline. I think it will be better to strip it ( in all logging of line )

Copy link
Member Author

Choose a reason for hiding this comment

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

Um, I'm not sure, the line might not contain a new line (the last line), the newline is processed by the agent definition so in some case you actually might know whether there is a new line or not.

Yes, it makes the logging a bit less readable but I'd rather prefer full info in the log.

Copy link
Member

@jreidinger jreidinger left a comment

Choose a reason for hiding this comment

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

LGTM

@lslezak
Copy link
Member Author

lslezak commented May 2, 2017

@mvidner what do you think about this? I'm not sure whether the reported false positives are acceptable or not. See the updated tests.

@lslezak
Copy link
Member Author

lslezak commented Jul 17, 2017

Um, let's close, it does not improve the situation much...

@lslezak lslezak closed this Jul 17, 2017
@lslezak lslezak deleted the any_agent_logging branch July 17, 2017 17:46
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.

None yet

2 participants