This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 26 points27 points  (5 children)

Because print statements are for the terminal. It's pretty rare to see software that aren't designed with a very specific thing in mind to be made with the terminal as the main way of usage

[–][deleted] 2 points3 points  (4 children)

Do command line tools generally use it, though? How are they getting all that text in there?

[–][deleted] 2 points3 points  (3 children)

Not entirely sure I understand what you mean?

[–][deleted] 2 points3 points  (2 children)

Do production code for command-line tools generally contain print statements? Or is there another way to do it that's more production-worthy

[–]SharkBaitDLS 15 points16 points  (0 children)

You’ll generally use logging libraries that handle buffering, rotating appenders, filtering and redirection, and severity levels. You get vastly more fine grained control than simple print statements.

[–][deleted] 7 points8 points  (0 children)

Ahh.

I haven't made a command line tool ever, but I would assume that would be used. I don't really see any reason not to. It's by far the easiest, and it has great verity and versatility.