Logging via Java API
Closed this issue · 4 comments
Logging from now on should be performed by
LoggerFactory.getLogger().{fine,info,severe}(String s)
or
LoggerFactory.getLogger().{fine,info,severe}(String s, Throwable th)
Places in the existing code where printing from System.out was used have been changed.
Logging properties can be changed by editing the config/logging.properties
file.
As it is now, all messages are recorded in one file named "deeco_core0.log", which resides in the user's home folder and gets overwritten on every run.
In addition, messages of "severe" level appear also always in the standard output.
Needs some more improvements
Just an example how it's done in Android.
http://developer.android.com/reference/android/util/Log.html
We can actually make a similar trick and create a class Log
with static methods representing the shortcuts for LoggerFactory.getLogger().{fine,info,severe}(String s)
Okay, LoggerFactory
is renamed to Log
, and extended to API for convenience.
The available methods are:
Log.(d,i,w,e}()
corresponding to the levels {DEBUG,INFO,WARNING,ERROR}