Separate logging into its own module. Print errors to proper stderr.
Separate logging into its own module. Print errors to proper stderr.