// Print a debug message with a variable func myFunc(c context.Context, name string) { c.Debugf("Hello, %s", name) }
// Print a debug message only if the app is running in a local development environment func myFunc(c context.Context, name string) { if appengine.IsDevAppServer() { c.Debugf("Hello, %s", name) } }This example shows how to use the Context Debugf function to print a debug message only if the app is running in a local development environment. The IsDevAppServer() function is part of the App Engine SDK and returns true if the app is running locally, and false if it's running on the production servers.