remove WithFields; add stereoscope logging

This commit is contained in:
Alex Goodman
2020-05-23 19:22:52 -04:00
parent 51c972ad33
commit 1b9effeb49
10 changed files with 49 additions and 69 deletions
+2 -8
View File
@@ -90,11 +90,7 @@ func (pres *Presenter) Present(output io.Writer, img *stereoscopeImg.Image, cata
fileMetadata, err := img.FileCatalog.Get(src)
if err != nil {
// TODO: test case
log.WithFields(map[string]interface{}{
"path": src.Path,
"id": src.ID(),
"presenter": "json",
}).Errorf("could not get metadata from catalog")
log.Errorf("could not get metadata from catalog (presenter=json): %+v", src)
}
srcObj := source{
@@ -110,9 +106,7 @@ func (pres *Presenter) Present(output io.Writer, img *stereoscopeImg.Image, cata
bytes, err := json.Marshal(&doc)
if err != nil {
log.WithFields(map[string]interface{}{
"presenter": "json",
}).Errorf("failed to marshal json: %w", err)
log.Errorf("failed to marshal json (presenter=json): %w", err)
}
_, err = output.Write(bytes)