库文件主函数中设置日志的意义是什么?
Opened this issue · 0 comments
pkuimyy commented
相关章节
CH02---感知机
相关主题
- 代码
- 文档
- 示例
问题描述
perceptron.py
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
ap = argparse.ArgumentParser()
ap.add_argument("-p", "--path", required=False, help="path to input data file")
args = vars(ap.parse_args())
else:
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
在单元测试中,以上设置日志的代码显然是有意义的,在库perceptron中包含这样的代码的作用是什么?