Merge pull request #43 from shenjackyuanjie/bugfix/crash-timezone
fix time zone in crash.py
This commit is contained in:
commit
8e9589e378
@ -77,7 +77,7 @@ def create_crash_report(info: Optional[str] = None) -> None:
|
|||||||
crash_info = crash_info_handler(info)
|
crash_info = crash_info_handler(info)
|
||||||
if 'crash_report' not in os.listdir('./'):
|
if 'crash_report' not in os.listdir('./'):
|
||||||
os.mkdir('./crash_report')
|
os.mkdir('./crash_report')
|
||||||
date_time = time.strftime('%Y-%m-%d %H-%M-%S', time.gmtime(time.time()))
|
date_time = time.strftime('%Y-%m-%d %H-%M-%S', time.localtime())
|
||||||
filename = f'crash-{date_time}.md'
|
filename = f'crash-{date_time}.md'
|
||||||
cache_stream = io.StringIO()
|
cache_stream = io.StringIO()
|
||||||
try:
|
try:
|
||||||
@ -92,7 +92,7 @@ def create_crash_report(info: Optional[str] = None) -> None:
|
|||||||
|
|
||||||
def write_cache(cache_stream, crash_info):
|
def write_cache(cache_stream, crash_info):
|
||||||
# 开头信息
|
# 开头信息
|
||||||
cache_stream.write(Head_message.format(now_time=time.strftime('%Y/%m/%d %H:%M:%S', time.gmtime(time.time()))))
|
cache_stream.write(Head_message.format(now_time=time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())))
|
||||||
# 崩溃信息
|
# 崩溃信息
|
||||||
cache_stream.write(crash_info)
|
cache_stream.write(crash_info)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user