pkulev / xoinvader

Python space game in terminal
http://mmap.me
MIT License
12 stars 1 forks source link

Implement logging to file #49

Closed alex-eg closed 7 years ago

alex-eg commented 7 years ago

While working on #19, I found myself in a dire need of logging facility.

I was debugging filter/list issue, and ncurses are not very friendly towards output that bypasses their own methods.

So I naturally did something like this:

with open("debug.log", "w") as f:
    ...
    print("List:", l, file=f)
    ...
    print("More info", info, file=f)

And so on. It was quite useful, but it's tedious to write this all by hand, and even more tedious to clean it all up. So I thought that we might benefit from having our own logging facility. In fact, I'm surprised that we don't have one yet.

UPD. It turned out we have logging after all. It's in utils.py. Whatever, then we need to have a wiki article on it.

pkulev commented 7 years ago

Logging in utils.py is bad implemented (not correctly configured root logger). There is issue about proper using of logging.

pkulev commented 7 years ago

Duplicates #27