先把代码贴出来,在http://www.crifan.com/summary_python_logging_module_usage/的基础上增加了部分内容
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------------------------------------
Function:
【整理】Python中的logging模块的使用(可以实现同时输出信息到cmd终端窗口和log文件(txt)中)
http://www.crifan.com/summary_python_logging_module_usage
Author: Crifan
Verison: 2012-11-23
-------------------------------------------------------------------------------
"""
import logging;
#-------------------------------------------------------------------------------
def loggingDemo():
"""Just demo basic usage of logging module
"""
logging.info("You should see this info both in log file and cmd window");
logging.warning("You should see this warning both in log file and