JakeWharton / hugo

Annotation-triggered method call logging for your debug builds.
Apache License 2.0
7.92k stars 797 forks source link

Add a 'verbose' parameter to @DebugLog which en-/disables the logging #82

Closed tschob closed 8 years ago

tschob commented 9 years ago

I would like to be able to give @DebugLog a parameter which en-/disables the logging. I don't wan't to see all logs everytime. So eg. if I'm interested in the api logs I would adjust my verbose constant to see them and if I'm interested in other parts I can disable them (to don't be distracted).

JakeWharton commented 9 years ago

Couldn't you just comment out the annotation to the same effect?

tschob commented 9 years ago

It would have the same effect, of course. But it's not my understanding of clean code and working efficiency to (un-)comment multiple lines of code instead of using one constant for it.

That's why there exists Hugo, isn't it? At least it would have the same effect to do a manually log in each method too. But it's not as clean and useful as the @DebugLog approach.

JakeWharton commented 9 years ago

I think I'll move the Hugo class into the public API and give it some options including a log hook for #60

JakeWharton commented 9 years ago

And, obviously, a setting for this

JakeWharton commented 8 years ago

Hugo.setEnabled just merged.