#!/usr/bin/python
# -*- coding:utf-8 -*-

import traceback
import datetime
import logging

# 自定义的日志输出
def log(msg, level = logging.DEBUG):
    logging.log(level, msg)
    print('%s [%s], msg:%s' % (datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), level, msg))

    if level == logging.WARNING or level == logging.ERROR:
        for line in traceback.format_stack():
            print(line.strip())

        for line in traceback.format_stack():
            logging.log(level, line.strip())

logging.basicConfig(
    filename = 'log/run.log',
    format = '%(asctime)s: %(message)s',
    level = logging.DEBUG
)

log( "开始下载升级文件...")

1caf9d15f6efa8031da25ccb056869078851aa01
<mask token>

<mask token>


def log(msg, level=logging.DEBUG):
    logging.log(level, msg)
    print('%s [%s], msg:%s' % (datetime.datetime.now().strftime(
        '%Y-%m-%d %H:%M:%S'), level, msg))
    if level == logging.WARNING or level == logging.ERROR:
        for line in traceback.format_stack():
            print(line.strip())
        for line in traceback.format_stack():
            logging.log(level, line.strip())


<mask token>

<mask token>


def log(msg, level=logging.DEBUG):
    logging.log(level, msg)
    print('%s [%s], msg:%s' % (datetime.datetime.now().strftime(
        '%Y-%m-%d %H:%M:%S'), level, msg))
    if level == logging.WARNING or level == logging.ERROR:
        for line in traceback.format_stack():
            print(line.strip())
        for line in traceback.format_stack():
            logging.log(level, line.strip())


logging.basicConfig(filename='log/run.log', format=
    '%(asctime)s: %(message)s', level=logging.DEBUG)
log('开始下载升级文件...')

import traceback
import datetime
import logging


def log(msg, level=logging.DEBUG):
    logging.log(level, msg)
    print('%s [%s], msg:%s' % (datetime.datetime.now().strftime(
        '%Y-%m-%d %H:%M:%S'), level, msg))
    if level == logging.WARNING or level == logging.ERROR:
        for line in traceback.format_stack():
            print(line.strip())
        for line in traceback.format_stack():
            logging.log(level, line.strip())


logging.basicConfig(filename='log/run.log', format=
    '%(asctime)s: %(message)s', level=logging.DEBUG)
log('开始下载升级文件...')

#!/usr/bin/python
# -*- coding:utf-8 -*-

import traceback
import datetime
import logging

# 自定义的日志输出
def log(msg, level = logging.DEBUG):
    logging.log(level, msg)
    print('%s [%s], msg:%s' % (datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), level, msg))

    if level == logging.WARNING or level == logging.ERROR:
        for line in traceback.format_stack():
            print(line.strip())

        for line in traceback.format_stack():
            logging.log(level, line.strip())

logging.basicConfig(
    filename = 'log/run.log',
    format = '%(asctime)s: %(message)s',
    level = logging.DEBUG
)

log( "开始下载升级文件...")
