Open techkang opened 2 weeks ago
Add a FileHandler to root logger.
FileHandler
Transformers is only using StreamHandler for logging, which makes debug analysis hard across different experiments. Many other frameworks support both logging to terminal and to file. For example: fairseq: https://github.com/facebookresearch/fairseq/blob/ecbf110e1eb43861214b05fa001eff584954f65a/fairseq_cli/train.py#L63-L65 detectron2: https://github.com/facebookresearch/detectron2/blob/8d85329aed8506ea3672e3e208971345973ea761/detectron2/utils/logger.py#L108
I can propose a PR.
If you feel like offering a PR, that would be great! It can likely just be a doc PR showing how to add a new logging handler serializing the logs to a file.
Feature request
Add a
FileHandler
to root logger.Motivation
Transformers is only using StreamHandler for logging, which makes debug analysis hard across different experiments. Many other frameworks support both logging to terminal and to file. For example: fairseq: https://github.com/facebookresearch/fairseq/blob/ecbf110e1eb43861214b05fa001eff584954f65a/fairseq_cli/train.py#L63-L65 detectron2: https://github.com/facebookresearch/detectron2/blob/8d85329aed8506ea3672e3e208971345973ea761/detectron2/utils/logger.py#L108
Your contribution
I can propose a PR.