func main() {
	// Load the configuration (isn't this easy?)
	l4g.LoadConfiguration("example.xml")

	// And now we're ready!
	l4g.Finest("This will only go to those of you really cool UDP kids!  If you change enabled=true.")
	l4g.Debug("Oh no!  %d + %d = %d!", 2, 2, 2+2)
	l4g.Info("About that time, eh chaps?")
}
Beispiel #2
0
func (p *Pipeline) Start() error {
	if p.State() == RUNNING {
		return errors.New("Pipeline is already running")
	}

	p.state = RUNNING

	go func(pipe *Pipeline) {
		for {
			select {
			case input := <-pipe.pipeInput.Input:
				fmt.Println(input)
			//pipe.process(input)

			case <-pipe.pipeInput.Quit:
				log4go.Info("Pipeline %s: Stopping", pipe.Name)
				pipe.state = STOPPED
				return
			}
		}
	}(p)

	return nil
}