Improve logging and error handling

- enable logging by default: debug was a bad name - it's error logging that I
  just want to hide in tests
- don't panic (all the time)
- use a logger. this allows us to add more information - like the path of the
  parsed file!
This commit is contained in:
Niklas Fasching 2018-12-19 20:04:12 +01:00
parent c23f8cc281
commit 7a8e90f786
5 changed files with 28 additions and 29 deletions

View file

@ -9,7 +9,7 @@ func TestHTMLWriter(t *testing.T) {
for _, path := range orgTestFiles() {
expected := fileString(path[:len(path)-len(".org")] + ".html")
reader, writer := strings.NewReader(fileString(path)), NewHTMLWriter()
actual, err := NewDocument().SetPath(path).Parse(reader).Write(writer)
actual, err := NewDocument().Silent().SetPath(path).Parse(reader).Write(writer)
if err != nil {
t.Errorf("%s\n got error: %s", path, err)
continue