k2-fsa / icefall

https://k2-fsa.github.io/icefall/
Apache License 2.0
792 stars 267 forks source link

Clear log handlers before setup #1603

Closed yfyeung closed 3 weeks ago

yfyeung commented 3 weeks ago

This PR adds functionality to clear existing log handlers before setting up new ones. This feature addresses issues in environments like torchrun, where default loggers cannot be easily overridden. By clearing previous handlers, we enable full customization and flexibility of logging configurations, ensuring that setups can be dynamically adjusted without being constrained by pre-existing environment settings.