I want to create a log function that logs the name of the file that is calling the log function followed by the message I want to log 'message'
functions.py
def log(text):
print(os.path.basename(__file__)+": "+text)
main.py
log('message')
this returns:
functions.py: message
I want it to return:
main.py: message