agbaraka
agbaraka

Reputation: 121

Disable info logs during testing a buffalo application

I am unable to disable INFO logs during testing.

Is there a way to do so?

Thanks.

Upvotes: 0

Views: 231

Answers (1)

dave
dave

Reputation: 64657

Set the buffalo.Options.Logger.Out to ioutil.Discard, you might have to create an instance of a logger to do it:

import (
    "github.com/gobuffalo/logger"
    "ioutil"
    // etc.
)

var noopLogger logger.Logrus
noopLogger.Out = ioutil.Discard
noopLogger.SetOutput(ioutil.Discard) // can't remember which one you need to do
buffalo.Options.Logger = noopLogger

Upvotes: 1

Related Questions