Solution for Google App Engine?
https://cloud.google.com/appengine/docs/go/logs/
This commit is contained in:
+3
-14
@@ -9,13 +9,12 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var cachedDebugLogger *log.Logger = nil
|
||||
|
||||
// TODO
|
||||
// func debugRoute(httpMethod, absolutePath string, handlers HandlersChain) {
|
||||
// func debugPrint(format string, values ...interface{}) {
|
||||
@@ -60,20 +59,10 @@ func TestDebugPrintError(t *testing.T) {
|
||||
|
||||
func setup(w io.Writer) {
|
||||
SetMode(DebugMode)
|
||||
if cachedDebugLogger == nil {
|
||||
cachedDebugLogger = debugLogger
|
||||
debugLogger = log.New(w, debugLogger.Prefix(), 0)
|
||||
} else {
|
||||
panic("setup failed")
|
||||
}
|
||||
log.SetOutput(w)
|
||||
}
|
||||
|
||||
func teardown() {
|
||||
SetMode(TestMode)
|
||||
if cachedDebugLogger != nil {
|
||||
debugLogger = cachedDebugLogger
|
||||
cachedDebugLogger = nil
|
||||
} else {
|
||||
panic("teardown failed")
|
||||
}
|
||||
log.SetOutput(os.Stdout)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user