2020年12月10日
import logging import colorlog import time from multiprocessing import Process, current_process def _job(event_id): [logging.root.removeHandler(handler) for handler in logging.root.handlers[:]] colorlog.basicConfig( level=logging.DEBUG, format="[%(asctime)s%(log_color)s%(levelname)-8s%(reset)s%(processName)spid:%(process)d] %(message)s" "%(name)s:%(lineno)d", filename="main_{0}.log".format(event_id), filemode='a+', ) count = 0 while True: time.sleep(0.1) logger = logging.getLogger(__name__) logger.error("fuck: {0}{1}".format(id(logger), event_id)) count += 1 if count == 100: break if __name__ == '__main__': jobs = [] # 生成 for _event_id in range(10): _p = Process(target=_job, name="{0}_{1}".format(current_process().name, _event_id), args=(_event_id,))……
阅读全文
2020年12月8日
JavaScript经典工具库 https://github.com/sorrycc/awesome-javascript https://www.cnblogs.com/fundebug/p/13_js_utilities_you_need.html Underscore或者Lodash Ramda MathJS Moment & date-fns Sugar Lazy CollectJS ChanceJS ChartJS Polished Mout Voca Licia 常见命令 安装包 # 本地安装 ### # 将安装……
阅读全文
2020年12月3日
WSGI规范(PEP 3333) WSGI 的全称是:Web Server Gateway Interface,介于 web server(uwsgi) 和应用 server (flask)之间的接口规范。当使用 Python 进行 web 开发时,……
阅读全文
2020年12月2日
Windows安装Crypto m2crypto vs pycrypto vs pycryptodome m2crypto:30+的星星,windows的兼容性较差,pip上面默认的版本不是whl包……
阅读全文
2020年11月23日
kafka集群安装文档 一、架构 # zookeeper和kafka架构 producer producer producer | | | -------------------- | zookeeper zookeeper zookeeper (zookeeper支持failover,至……
阅读全文
2020年11月10日
axios链式请求 const axios = require('axios') // 全局配置文件 axios.defaults.baseURL = 'https://httpbin.org'; axios.defaults.timeout = 100000; console.log('第一次异步请求数据:/json'); axios.get('/json').then(response……
阅读全文