feat(errors): add option to log errors instead of emitting them

Improves error logging by using the Diagnostic instances from typescript compiler.
Add support for options.logErrors, which by default is true.