我尝试过dir(logging.FileHandler),但没有看到任何可能的解决方案.
>>> import logging >>> fh = logging.FileHandler('/Users/defuz/test.txt') >>> fh.baseFilename '/Users/defuz/test.txt' >>> fh.stream.name '/Users/defuz/test.txt'