make sure errors and warnings are logged

We should be using our logging facility at all times, not perl's built
in warn() (which is just `print STDERR "stuff", caller`)