From 0b63f049b38d113c0c46c13bd62edf5e870922a4 Mon Sep 17 00:00:00 2001 From: Juhani Haverinen Date: Mon, 25 Jul 2016 14:40:09 +0300 Subject: [PATCH] Add timestamps to logs --- gophersrv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gophersrv.py b/gophersrv.py index ab93f68..303c9cd 100644 --- a/gophersrv.py +++ b/gophersrv.py @@ -32,6 +32,7 @@ import socket import stat import subprocess import threading +import time # Config port = 7070 @@ -309,5 +310,5 @@ while True: if not any(map(lambda x: matchaddr(toint(ip), x), blacklist)): Serve(conn).start() else: - print 'Blacklisted IP %s' % ip + print '%s: Blacklisted IP %s' % (time.strftime('%Y-%m-%d %H:%M'), ip) conn.close()