Beispiel #1
0
// SetLogLevel sets log level.
// Log level must be one of debug, info, warning, error, fatal and panic.
func (app *App) SetLogLevel(str string) error {
	level, err := log.ParseLevel(str)
	if err != nil {
		return err
	}

	log.SetLevel(level)

	return nil
}
	log "gopkg.in/Sirupsen/logrus.v0"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

type Fake struct {
	id    string
	value string
}

var _ = Describe("QueueUnique", func() {
	//log.SetOutput(os.Stderr)
	log.SetOutput(GinkgoWriter)
	log.SetLevel(log.DebugLevel)

	var uq *UniqueQueue
	matcherID := func(fake interface{}) string {
		return fake.(*Fake).id
	}
	faked := &Fake{id: "1234", value: "5678"}

	AfterEach(func() {
		uq.Close()
		uq = nil
	})

	It("should initialise to empty", func() {
		uq = (&UniqueQueue{
			MatcherID: matcherID,