Dragon2fly/logger_tt

[Feature Request] Let `log_path` overwrites filename for each handler separately

Closed this issue · 3 comments

In log_config.json it is possible to initialize multiple file handlers with different destination files, but when log_path is given, filename for every file handler is modified so that all of them point to the same file. I think it is better to enable log_path to recieve a dict as well. Passing a string keeps the current behavior and passing a dict assigns a filename for each handler according to their key in config file.

I think it is a good idea. Can you implement it in the ensure_path function?

Yes, I have implemented it here

For adding testcases, shall I create a separate log_config.json for test purpose only or modify the original one for easier demostration for this feature?

Yes, you will create a new config file but not directly.
You could reference this test case for how to modify and save a new the log config file on the fly.
The referenced test case uses log_config.yaml but the logic for log_config.json is also similar.