// Test logging with the go logger. func TestGoLogger(t *testing.T) { log.SetOutput(os.Stdout) applog.SetLevel(applog.LevelDebug) applog.SetLogger(applog.GoLogger{}) applog.Debugf("Debug.") applog.Infof("Info.") applog.Warningf("Warning.") applog.Errorf("Error.") applog.Criticalf("Critical.") }
// Test logging with an own logger. func TestOwnLogger(t *testing.T) { assert := asserts.NewTestingAsserts(t, true) ownLogger := &testLogger{[]string{}} applog.SetLevel(applog.LevelDebug) applog.SetLogger(ownLogger) applog.Debugf("Debug.") applog.Infof("Info.") applog.Warningf("Warning.") applog.Errorf("Error.") applog.Criticalf("Critical.") assert.Length(ownLogger.logs, 5, "Everything logged.") }
func setupLogger(level int) { logger := applog.GoLogger{} applog.SetLevel(level) applog.SetLogger(logger) }