I have the following code with a function to write into a log file, for some reason it doesn't work :-|
#!/usr/nin/env python
log_buffer = ""
def print_log(msg):
global log_buffer
log_buffer += msg + "\n"
return
with open("logging.log","at") as log:
log.write(msg+"\n")
print_log("Test")
Any idea what am I missing here?