Each has it's own capabilities.
Print lets you write:
- to a hard coded file path
- to stdout
- to stderr
- only what you say to write
Logging lets you write
- to a user configured file path
- to a user configured logging level
- to stdout
- to stderr
- many prefix fields (timestamps, etc.) that you may not want
These days I only use print
when writing debugging scaffolding code. That is, code that never makes it into production. I write it only for me with a little //TODO remove
comment next to it that helps me keep it out of production.
Sure, printing to stdout and stderr can be redirected. But most applications update more than two files. Sure, print doesn't have to work from a hard coded file path. But now you have to write code to make the file path configurable.
Logging is built from Print. So with enough effort you can make Print do all the same things Logging does. But if you need those things use what already has them.
In a interactive command line application, if I ask for user input and he gives me wrong input, should I print the error message or should I log it? If I should print it, to where, stdout or stderr?
You can log it to stderr in most logging systems. Doing it this way gives users the ability to reconfigure where it goes without making them redirect stderr every time they run it.
If that's not an issue, printing to stderr still works as well as it ever did.