dongtang4019 2013-09-16 04:20
浏览 40
已采纳

如何在GAE Go运行时中记录消息?

I am using the following simple code snippet to log messages in my application and during local testing I see all my logs.

However, I do not see any application logs when I deploy the app to GAE. Do I need to set logging properties anywhere? Or am I using the wrong logging library?

import (
    "log"
)

func Info(logMessage string, v ...interface{}) {
    if v != nil {
        log.Printf("[INFO]  "+logMessage, v)
    } else {
        log.Printf("[INFO]  " + logMessage)
    }
}
  • 写回答

2条回答 默认 最新

  • doutao6380 2013-09-16 04:54
    关注

    You should be using the app engine logging provided with the Context interface.
    It provides several Debugf, Infof, Warningf, Errorf, and Criticalf.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?