Closed AlessandroLovo closed 9 months ago
Actually I noticed that this happens only for the children of Learn2_new
, but not on Learn2_new
itself.
I think this is due to the fact that when we inherit from Learn2_new
, its logger is not the root one
Now you can use @ut.exec_time(logger)
to explicitly provide the logger. @ut.execution_time
remains for backward compatibility, with its old buggy behavior.
With this fix we have a correct logging to file, but no longer on stdout
Nevermind, the bug was elsewhere
When we decorate a function with
@ut.execution_time
, the information is logged usingut.logger
. This means that if the decorated function is also logging something onto a file with its own logger, the execution time informations won't appear in the file.It'd be better to pass the logger to the decorator.