You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
296 B

7 days ago
# -*- coding: utf-8 -*-
# t11-tail.py — 应用日志尾部(读最后 60 行)
import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
with open('logs/crm-app.log', 'r', encoding='utf-8', errors='replace') as f:
lines = f.readlines()
print(''.join(lines[-60:]))