#!/usr/bin/env python3 # -*- coding: utf-8 -*- from AnsjerPush.config import BASE_DIR class LogUtil: @staticmethod def write_log(file_path=None, log=''): if not file_path: file_path = '/'.join((BASE_DIR, 'static/test.log')) file = open(file_path, 'a+') file.write(log) file.write('\n') file.flush() file.close()