added timestamps

This commit is contained in:
jan6 2021-10-07 22:36:09 +03:00
parent 5412493052
commit 0c84a52bc7
2 changed files with 4 additions and 5 deletions

View File

@ -2,8 +2,7 @@ import irctokens
from config import config as Config
from util import Util
from commands import Command
import sys, importlib
import sys, importlib, time
def stuff(bot, sock):
config = Config
@ -63,7 +62,7 @@ def stuff(bot, sock):
stri = line.format()
for k, v in util.dict.items():
stri = stri.replace(k, v)
print(f"< {stri}")
print(f"{time.strftime('%H:%M:%S')} < {stri}")
del stri
if line.command == "PING":

View File

@ -1,5 +1,5 @@
import irctokens
import time
class Util:
def __init__(self, config, sock):
@ -46,7 +46,7 @@ class Util:
stri = raw
for k, v in self.dict.items():
stri = stri.replace(k, v)
print(f"> {stri}")
print(f"{time.strftime('%H:%M:%S')} > {stri}")
self.sock.sendall(f"{raw}\r\n".encode("utf8"))
def quit(self, msg=None):