Hello!
I am making a game engine, and need to interact with native code often. I have some abstractions that help me; But I use them in both critical and non-critical contexts.
For example, I have a Closer class that collects AutoCloseables with a nice syntax, then when closed, closes all of them in the correct order. For some usages, I want to log its internals - sometimes, not. So I end up passing a LogLevel to the constructor.
Issue is --- I have to create my own trace, debug etc. functions with the logic, and pass the LogLevel to them. How would you recommend handling this?
Hello!
I am making a game engine, and need to interact with native code often. I have some abstractions that help me; But I use them in both critical and non-critical contexts.
For example, I have a
Closerclass that collectsAutoCloseables with a nice syntax, then when closed, closes all of them in the correct order. For some usages, I want to log its internals - sometimes, not. So I end up passing aLogLevelto the constructor.Issue is --- I have to create my own
trace,debugetc. functions with the logic, and pass theLogLevelto them. How would you recommend handling this?