Ejemplo n.º 1
0
// NewEnv creates a dccp.Env for test purposes, whose dccp.Guzzle writes to a file
// and duplicates all emits to any number of additional guzzles, which are usually used to check
// test conditions. The GuzzlePlex is returned to facilitate adding further guzzles.
func NewEnv(guzzleFilename string, guzzles ...dccp.Guzzle) (env *dccp.Env, plex *GuzzlePlex) {
	fileGuzzle := dccp.NewFileGuzzle(path.Join(os.Getenv("DCCPLOG"), guzzleFilename+".emit"))
	plex = NewGuzzlePlex(append(guzzles, fileGuzzle)...)
	return dccp.NewEnv(plex), plex
}
Ejemplo n.º 2
0
// NewEnv creates a dccp.Env for test purposes, whose dccp.TraceWriter writes to a file
// and duplicates all emits to any number of additional guzzles, which are usually used to check
// test conditions. The TraceWriterPlex is returned to facilitate adding further guzzles.
func NewEnv(guzzleFilename string, guzzles ...dccp.TraceWriter) (env *dccp.Env, plex *TraceWriterPlex) {
	fileTraceWriter := dccp.NewFileTraceWriter(path.Join(os.Getenv("DCCPLOG"), guzzleFilename+".emit"))
	plex = NewTraceWriterPlex(append(guzzles, fileTraceWriter)...)
	return dccp.NewEnv(plex), plex
}
Ejemplo n.º 3
0
// NewEnv creates a dccp.Env for test purposes, whose dccp.TraceWriter writes to a file
// and duplicates all emits to any number of additional guzzles, which are usually used to check
// test conditions. The TraceWriterPlex is returned to facilitate adding further guzzles.
func NewEnv(guzzleFilename string) (env *dccp.Env, plex *TraceWriterPlex) {
	fileTraceWriter := dccp.NewFileTraceWriter(path.Join(os.Getenv("DCCPLOG"), guzzleFilename+".emit"))
	plex = NewTraceWriterPlex(fileTraceWriter)
	return dccp.NewEnv(NewSyncTraceWriter(plex)), plex
}