mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
better logs
This commit is contained in:
parent
bff20889c1
commit
882c9753bd
1 changed files with 4 additions and 4 deletions
|
@ -367,9 +367,9 @@ def client_thread(ipaddr,conn):
|
|||
conn.close()
|
||||
return
|
||||
|
||||
print time.asctime(), "new session", version, ipaddr, session_id, addresses[0] if addresses else addresses, len(addresses)
|
||||
print time.strftime("[%d/%m/%Y-%H:%M:%S]"), "new session", ipaddr, addresses[0] if addresses else addresses, len(addresses), "v"+version
|
||||
|
||||
sessions[session_id] = { 'addresses':{}, 'version':version }
|
||||
sessions[session_id] = { 'addresses':{}, 'version':version, 'ip':ipaddr }
|
||||
for a in addresses:
|
||||
sessions[session_id]['addresses'][a] = ''
|
||||
out = repr( (session_id, config.get('server','banner').replace('\\n','\n') ) )
|
||||
|
@ -383,7 +383,7 @@ def client_thread(ipaddr,conn):
|
|||
conn.close()
|
||||
return
|
||||
|
||||
print time.asctime(), "update session", ipaddr, session_id, addresses[0] if addresses else addresses, len(addresses)
|
||||
print time.strftime("[%d/%m/%Y-%H:%M:%S]"), "update session", ipaddr, addresses[0] if addresses else addresses, len(addresses)
|
||||
|
||||
sessions[session_id]['addresses'] = {}
|
||||
for a in addresses:
|
||||
|
@ -525,7 +525,7 @@ def clean_session_thread():
|
|||
for k,s in sessions.items():
|
||||
t0 = s['last_time']
|
||||
if t - t0 > 5*60:
|
||||
print time.asctime(), "lost session",k
|
||||
print time.strftime("[%d/%m/%Y-%H:%M:%S]"), "end session", s['ip']
|
||||
sessions.pop(k)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue