diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2017-03-30 21:07:45 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2017-03-30 21:07:45 +0300 |
| commit | 73e1db4ea519fffb5f4c23d3bc348ee5f15f14a3 (patch) | |
| tree | 383cd1ec2aed7978d0a9be2fee7351402c5acaaf | |
| parent | ad354278c38e7aace7d3738988ac613a6fece61f (diff) | |
Add timestamps to inbound messages
| -rwxr-xr-x | client.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -7,6 +7,8 @@ Created on 29.3.2017 import socket import time +from time import gmtime, strftime + import threading import signal from datetime import datetime @@ -72,7 +74,8 @@ def listen_messages(): debug(username) debug(body) if username != nick: - print(username + ": " + body) + timestamp = strftime("%H:%M:%S", gmtime()) + print("{} {}: {}".format(timestamp, username, body)) host = input("Host [{}]: ".format(DEFAULT_HOST)) nick = input("Nickname [{}]: ".format(DEFAULT_NICK)) |
