Yes, I suppose a simple parameter would do the job. Probably not worth anything fancy.
Many Java logging systems allow you to enable/disable logging per package, but this is still not enough for a per function decision.
Logging is a hard problem.
I have something for that. [1]
[1] https://tersesystems.github.io/blindsight/usage/conditional....
[1] https://stackoverflow.com/questions/46062711/show-logs-only-...
[2] https://stackoverflow.com/questions/30248169/how-to-deal-wit...
The fact that logging is at all intermixed with business logic I think is the main problem. I should be able to take a fully working logless program and apply different logging profiles to it. What gets logged should be a function of the person invoking the program.