📄 Logging

This commit is contained in:
NikolajDanger
2020-07-30 11:02:36 +02:00
parent 8e6a6e0b55
commit c6a7f35602
2 changed files with 60 additions and 55 deletions

View File

@ -100,10 +100,15 @@ def imageFunc():
logThis("Couldn't connect to bing (error code 701)")
return(image)
def logThis(message : str):
def logThis(message : str, channel = ""):
localtime = time.asctime(time.localtime(time.time()))
print(localtime+" - "+message)
logging.info(localtime+" - "+message)
channel = channel.replace("Direct message with ","")
if channel == "":
print(localtime+" - "+message)
logging.info(localtime+" - "+message)
else:
print(localtime+" ("+channel+") - "+message)
logging.info(localtime+" ("+channel+") - "+message)
# Finds a page from the Senkulpa Wikia
def findWikiPage(search : str):