You've already forked calibre-plugins
mirror of
https://github.com/crosspoint-reader/calibre-plugins.git
synced 2026-04-29 10:26:59 -07:00
bb036730c8
Source from @itsthisjustin in https://github.com/crosspoint-reader/crosspoint-reader/pull/404
18 lines
290 B
Python
18 lines
290 B
Python
import time
|
|
|
|
|
|
_LOG = []
|
|
_MAX_LINES = 200
|
|
|
|
|
|
def add_log(message):
|
|
timestamp = time.strftime('%H:%M:%S')
|
|
line = f'[{timestamp}] {message}'
|
|
_LOG.append(line)
|
|
if len(_LOG) > _MAX_LINES:
|
|
_LOG[:len(_LOG) - _MAX_LINES] = []
|
|
|
|
|
|
def get_log_text():
|
|
return '\n'.join(_LOG)
|