Uniformize and simplify printing initialization procedure

Currently there are multiple paths which need to initialize printing.
These paths all share similar code. Use a function to make the procedure
more clear and uniform.

BUG=455764

Change-Id: I193142e0b325071020c4e58def7156b9fbacb29f
Reviewed-on: https://chromium-review.googlesource.com/620249
Commit-Queue: Wei Li <weili@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496106}
6 files changed