How to write logs in app engine

78 views
Skip to first unread message

mschlimp

unread,
Apr 23, 2017, 11:05:25 AM4/23/17
to google-appengine-go
I create a simple basic appengine go project where I try to log some infos.

package controller

import (
  "net/http"
  "appengine"
  "appengine/blobstore"
  "appengine/log"

  "html/template"
  "time"
  "strconv"

  "entity"
)

...

func AdminSaveProduct(w http.ResponseWriter, r *http.Request) {
  ctx := appengine.NewContext(r)
  
  log.Infof(ctx, "info: %s", "test test")

  ...
}

...

I got the error: undefined: "appengine/log".Infof


What do I wrong?
marcel

mschlimp

unread,
Apr 23, 2017, 12:21:55 PM4/23/17
to google-appengine-go
Oh,

i have to use 

ctx.Infof(...)
Reply all
Reply to author
Forward
0 new messages