Closed TesteurManiak closed 1 year ago
Setting verbose to false seem to disable every log. Maybe we want to always keep severe logs. Or instead of a boolean flag, we can let the user directly set the log level he want
@Pierre-Monier That's fair, may I suggest that we adopt a logic similar to the logging package which means that the Logger
class would have a level
setter to define the minimum level of the log to be displayed. By default the level would be Level.info
so it would still display log of Level.severe
while ignoring Level.fine
message or lower.
And can be changed on the fly just by doing Matomo.instance.log.level = Level.all
.
@Pierre-Monier That's fair, may I suggest that we adopt a similar logic that the logging package which means that the
Logger
class would have alevel
setter to define the minimum level of the log to be displayed. By default the level would beLevel.info
so it would still display log ofLevel.severe
while ignoringLevel.fine
message or lower. And can be changed on the fly just by doingMatomo.instance.log.level = Level.all
.
I mostly agree with it. However, in my opinion, the log level should be set during initialization. This is when we configure the package, so it makes sense to set the log level at this stage.
Added the
verbose
flag toMatomo.instance.initialize()
method.I had to refactor a bit the way we handle logs so it could be testable.