Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( SlowTest = 10 * time.Second SlowFlush = 5 * time.Second )
var WriterCloser = &testLoggerWriterCloser{}
Functions ¶
func NewTestLogger ¶
func NewTestLogger() log.LoggerProvider
NewTestLogger creates a TestLogger as a log.LoggerProvider
func PrepareTestEnv ¶
func PrintCurrentTest ¶
PrintCurrentTest prints the current test to os.Stdout
func Printf ¶
func Printf(format string, args ...interface{})
Printf takes a format and args and prints the string to os.Stdout
func ResetFixtures ¶
resetFixtures flushes queues, reloads fixtures and resets test repositories within a single test. Most tests should call defer tests.PrepareTestEnv(t)() (or have onGiteaRun do that for them) but sometimes within a single test this is required
Types ¶
type TestLogger ¶
type TestLogger struct {
log.WriterLogger
}
TestLogger is a logger which will write to the testing log
func (*TestLogger) Content ¶
func (log *TestLogger) Content() (string, error)
Content returns the content accumulated in the content provider
func (*TestLogger) GetName ¶
func (log *TestLogger) GetName() string
GetName returns the default name for this implementation
func (*TestLogger) Init ¶
func (log *TestLogger) Init(config string) error
Init inits connection writer with json config. json config only need key "level".
func (*TestLogger) ReleaseReopen ¶
func (log *TestLogger) ReleaseReopen() error
ReleaseReopen does nothing