openjump-gis / openjump

OpenJUMP, the Open Source GIS with more than one trick in its kangaroo pocket, takes the leap from svn to git. join the effort!
http://openjump.org
GNU General Public License v2.0
28 stars 14 forks source link

Logging upgrade part 1: Consistently use the internal workbench.Logger #50

Closed Neutius closed 2 years ago

Neutius commented 2 years ago

This is the first step towards resolving https://github.com/openjump-gis/openjump/issues/49

Only the workbench.Logger class should be aware of the logging implementation used (currently Log4j 1, will be upgraded to Log4j 2 soon).

There were 6 classes directly using the Log4j 1 logging implementation. Those classes now use the internal workbench.Logger class.

I also expanded the .gitignore for IntelliJ IDE config files, to prevent accidentally committing those.

edeso commented 2 years ago

i quickly threw something together to abstract the Log Levels https://github.com/openjump-gis/openjump/commits/loggerlevels https://github.com/openjump-gis/openjump/commit/4d40782dbd4986bf9497f9feaa4a6d5763e33ad5

feel free to reuse or ignore :)

Neutius commented 2 years ago

@edeso I found your commit quite useful, but I did make a few different decisions.

I used an enum type, since an enum does all that we need out of the box, so we don't need to compare String values ourselves.

For the enum type name, I chose LogLevel over "Level", both to prevent namespace conflict with log4j Level, and to make the intended purpose more explicit. Within a logging framework "Level" is specific enough, but within in a broader application context "Level" could mean dozens of things.

edeso commented 2 years ago

No problem. as long as it works! looking forward to your Log4J 2.x port :)