Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Commit

Permalink
Update log format calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kieltyka committed Sep 28, 2015
1 parent 6394eb2 commit f7a2a8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (b *Bucket) AddImagesFromUrls(urls []string) ([]*Image, error) {
if r.Status == 200 && len(r.Data) > 0 {
images[i].Data = r.Data
if err = images[i].LoadImage(); err != nil {
lg.Error("LoadBlob data for %s returned error: %s", r.URL.String(), err)
lg.Errorf("LoadBlob data for %s returned error: %s", r.URL.String(), err)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ func BucketGetItem(c web.C, w http.ResponseWriter, r *http.Request) {
// that use it..
bucket, err := NewBucket(c.URLParams["bucket"])
if err != nil {
lg.Error("Failed to create bucket for %s cause: %s", r.URL, err)
lg.Errorf("Failed to create bucket for %s cause: %s", r.URL, err)
respond.ImageError(w, 422, err)
return
}

sizing, err := imgry.NewSizingFromQuery(r.URL.RawQuery)
if err != nil {
lg.Error("Failed to create sizing for %s cause: %s", r.URL, err)
lg.Errorf("Failed to create sizing for %s cause: %s", r.URL, err)
respond.ImageError(w, 422, err)
return
}

im, err := bucket.GetImageSize(c.URLParams["key"], sizing)
if err != nil {
lg.Error("Failed to get image for %s cause: %s", r.URL, err)
lg.Errorf("Failed to get image for %s cause: %s", r.URL, err)
respond.ImageError(w, 422, err)
return
}
Expand Down Expand Up @@ -106,13 +106,13 @@ func BucketFetchItem(c web.C, w http.ResponseWriter, r *http.Request) {
return
}

// lg.Info("BucketFetchItem, after DbFindImage... %v", err)
// lg.Infof("BucketFetchItem, after DbFindImage... %v", err)

// Fetch the image on-demand and add to bucket if we dont have it
if err == ErrImageNotFound {
_, err := bucket.AddImagesFromUrls([]string{fetchUrl})
if err != nil {
lg.Error("Fetching failed for %s because %s", fetchUrl, err)
lg.Errorf("Fetching failed for %s because %s", fetchUrl, err)
respond.ImageError(w, 422, err)
return
}
Expand Down
2 changes: 1 addition & 1 deletion server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func RequestLogger(next http.Handler) http.Handler {
lw := &loggedResponseWriter{w, -1}
next.ServeHTTP(lw, r)

lg.Infof("Completed (%s): %v %s in %v\n",
lg.Infof("Completed (%s): %v %s in %v",
u,
lw.Status(),
http.StatusText(lw.Status()),
Expand Down

0 comments on commit f7a2a8c

Please sign in to comment.