java-diff-utils icon indicating copy to clipboard operation
java-diff-utils copied to clipboard

Setting log levels

Open augustd opened this issue 3 years ago • 1 comments

I am trying to parse a rather large diff file with UnifiedDiff udf = UnifiedDiffReader.parseUnifiedDiff(diff);

It is choking on the file and giving me the error message:

Jul 28, 2022 12:52:33 AM com.github.difflib.unifieddiff.UnifiedDiffReader processLine
WARNING:   >>> no rule matched 
Exception in thread "main" com.github.difflib.unifieddiff.UnifiedDiffParserException: expected file start line not found
	at com.github.difflib.unifieddiff.UnifiedDiffReader.parse(UnifiedDiffReader.java:120)
	at com.github.difflib.unifieddiff.UnifiedDiffReader.parseUnifiedDiff(UnifiedDiffReader.java:191)

The source code shows that the "no rule matched" line is supposed to include the offending line, but in this case that is an empty line. Naturally I want to turn on some finer logging to show some context of the previous lines so I can find the bad line in my diff file. How do I do that?

BTW the error message could be greatly improved by including the line number.

augustd avatar Jul 28 '22 08:07 augustd

To increase log level use a logging properties. The surefire plugin in the project is already configured this way.

However better log messages is always a good way to improve user experience.

wumpz avatar Aug 17 '22 18:08 wumpz

Stale issue message

github-actions[bot] avatar Jan 05 '23 02:01 github-actions[bot]