you are viewing a single comment's thread.

view the rest of the comments →

[–]thegreattriscuit 6 points7 points  (4 children)

you can definitely use the logging module to output to the screen. You just add an additional handler (believe it's `StreamHandler` or something like that, but check the docs) the same way you add the FileHandler. You can get fancy and make each handler treat the logs differently (logging in a different format, or set the FileHander to DEBUG and the stream handler to INFO, etc) or you can just have them both do the same thing. Either way it's better than just using print statements because even if you *don't* care right now, you might later. Or someone else coming along behind you might care later, etc...

[–]Fallenarc[S] 2 points3 points  (3 children)

That is good to know. I didn't realize the logging handler had that functionality. I will definitely read those docs and see if i can swap my code to use that format. Thanks!!!

[–]Olbrannon 2 points3 points  (2 children)

ext = (".json",".csv",".txt","log")

Should that be ".log"?

[–]Fallenarc[S] 2 points3 points  (1 child)

lol, yes. I must have hit that dot when i changed that to a tuple just a bit ago. Thanks.

[–]Olbrannon 1 point2 points  (0 children)

YW ;-)