better loggings but i need to fix a duplicate log line error
This commit is contained in:
@@ -39,11 +39,11 @@ async def show_logs(update, context):
|
||||
return _log.log_warning(f'open_logs: user {chat_id} not allowed')
|
||||
|
||||
await update.message.reply_text('Sto provando ad aprire i log...')
|
||||
_log.log_info(f'open_logs: {chat_id} trying opening logs...')
|
||||
_log.log_debug(f'open_logs: {chat_id} trying opening logs...')
|
||||
try:
|
||||
game_log= _os.path.expanduser(f'{_botsyms.BOT_PATH}/{_log.get_log_name()}')
|
||||
game_log= _os.path.expanduser(f'{_log.get_log_name()}')
|
||||
with open(game_log, 'r') as _log_file:
|
||||
lines= _log_file.readlines()[-20:]
|
||||
lines= _log_file.readlines()[-30:]
|
||||
log_content= '\n'.join(lines)
|
||||
await update.message.reply_text(f"Contenuto del log:\n{log_content}")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user