Print replaced by logging in expr, gui and linear folders

Continuation of the pull request #718 for issue #41.