There is a debug level being set in a config file. We grab that value at store it in a variable on a class and use that value from there on out. It is hit roughly 500-4000 times during server startup, depending on the environment.
Is there a common work around or design pattern that would allow us to get that value at the beginning and then run the code base depending on its value? The end end goal would be to not have to query that parameter from the other class 400-4000 times during startup in an if statement to decide if we are supposed to log a statement or not depending on the debug level being used.
Thanks!
Aucun commentaire:
Enregistrer un commentaire