u/logging: Refactor printing to be safer using truncating helpers, and more have a higher code reuse.