Python Write Better Python Buggy Logs Logging

jayda hendrickson
jayda hendrickson
3,413 Points

Logging

Can someone explain the basic concept of logging to me??? I just don't understand the point of it at all, and why did he use 'cat'

1 Answer

Jebadeiah Jones
Jebadeiah Jones
10,375 Points

The point of logging events is to be able to review those logs if something's not acting properly, usually. Sometimes it's just to gather data and other times it's to optimize a process. If you notice that you're logging a certain process far more frequently than you'd expect, you'll be more inclined to review your code and see why that is the case. It's also used similarly to the Event Logger in Windows. If your game is crashing, you'll want to see what's happened right before it's crashing to see if you can isolate the event that's causing the crash.

The cat command had me confused, as well. It seems to be a Linux command, short for concatenate, and its use here seems identical to the python print() function. I suspect he used it because they're using a Linux console. I bet it's one of those things that just makes sense if you use Linux all of the time, but sticks out as strange if you're more accustomed to Windows.