I was running the tests for the lexer (https://github.com/d-u-d-e/c-compiler/pull/6), and since we are calling the lexer run method which contains logger.info() calls, every test prints out logs. I'm not sure how useful they are during test runs. That said, I think it's useful to implement a way to turn off log messages when needed.
Maybe Loguru comes with a built-in function you can call at the top of a file that turns off the logs.
Another way is to give a parameter to the lexer run method, e.g. verbosity. But I prefer a solution like the one above.
I was running the tests for the lexer (https://github.com/d-u-d-e/c-compiler/pull/6), and since we are calling the lexer run method which contains
logger.info()
calls, every test prints out logs. I'm not sure how useful they are during test runs. That said, I think it's useful to implement a way to turn off log messages when needed.Maybe Loguru comes with a built-in function you can call at the top of a file that turns off the logs.
Another way is to give a parameter to the lexer run method, e.g.
verbosity
. But I prefer a solution like the one above.