At the moment, it is impossible to set the log level at run-time. Paintera depends on slf4j-api and not on a specific implementation and the slf4j-api does not expose a way of setting the log level at runtime. Currently, a slf4j implementation has to be added to the classpath at runtime, slf4j-simple in the paintera-cmd and
the log level can be set only at start-up by setting appropriate JVM environment through -Dorg.slf4j.simpleLogger..... The paintera project is not intended to be a library but an application (core features can be extracted for re-use, e.g. saalfx, and it would thus make sense to add an explicit to an slf4j implementation. Of all the slf4j implementations, only logback exposes API to change the log level programatically, to the best of my knowledge.
I suggest:
Use explicit sl4fj-logback dependency
Add command line argument --log-level to set log level for root logger/specific classes
Add UI elements to control log level
Remove slf4j-simple from paintera-cmd
(Optional) If possible with logback: Add option to specifiy log target, i.e. stdout, file, or both.
At the moment, it is impossible to set the log level at run-time. Paintera depends on
slf4j-api
and not on a specific implementation and theslf4j-api
does not expose a way of setting the log level at runtime. Currently, a slf4j implementation has to be added to the classpath at runtime,slf4j-simple
in the paintera-cmd and the log level can be set only at start-up by setting appropriate JVM environment through -Dorg.slf4j.simpleLogger..... The paintera project is not intended to be a library but an application (core features can be extracted for re-use, e.g.saalfx
, and it would thus make sense to add an explicit to anslf4j
implementation. Of all theslf4j
implementations, only logback exposes API to change the log level programatically, to the best of my knowledge.I suggest:
sl4fj-logback
dependency--log-level
to set log level for root logger/specific classesslf4j-simple
from paintera-cmd