hydra/in_tail.go
func (t *InTail) Run(c *Context) {
	c.InputProcess.Add(1)
	defer c.InputProcess.Done()

	t.messageCh = c.MessageCh
	t.monitorCh = c.MonitorCh

	c.StartProcess.Done()

	if t.eventCh == nil {
		err := t.TailStdin(c)
		if err != nil {
			if _, ok := err.(Signal); ok {
				log.Println("[info]", err)
			} else {
				log.Println("[error]", err)
			}
			return
		}
	}

	log.Println("[info] Trying trail file", t.filename)
	f, err := t.newTrailFile(SEEK_TAIL, c)
	if err != nil {
		if _, ok := err.(Signal); ok {
			log.Println("[info]", err)
		} else {
			log.Println("[error]", err)
		}
		return
	}
	for {
		for {
			err := t.watchFileEvent(f, c)
			if err != nil {
				if _, ok := err.(Signal); ok {
					log.Println("[info]", err)
					return
				} else {
					log.Println("[warning]", err)
					break
				}
			}
		}
		// re open file
		var err error
		f, err = t.newTrailFile(SEEK_HEAD, c)
		if err != nil {
			if _, ok := err.(Signal); ok {
				log.Println("[info]", err)
			} else {
				log.Println("[error]", err)
			}
			return
		}
	}
}
func (t *InTail) Run(c *Context) {
	c.InputProcess.Add(1)
	defer c.InputProcess.Done()

	t.messageCh = c.MessageCh
	t.monitorCh = c.MonitorCh

	c.StartProcess.Done()

	if t.eventCh == nil {
		err := t.TailStdin(c)
		if err != nil {
			if _, ok := err.(Signal); ok {
				log.Println("[info]", err)
			} else {
				log.Println("[error]", err)
			}
			return
		}
	}

	log.Println("[info] Trying trail file", t.filename)
	f, err := t.newTrailFile(SEEK_TAIL, c)
	if err != nil {
		if _, ok := err.(Signal); ok {
			log.Println("[info]", err)
		} else {
			log.Println("[error]", err)
		}
		return
	}
	for {
		for {
			err := t.watchFileEvent(f, c)
			if err != nil {
				if _, ok := err.(Signal); ok {
					log.Println("[info]", err)
					return
				} else {
					log.Println("[warning]", err)
					break
				}
			}
		}
		// re open file
		var err error
		f, err = t.newTrailFile(SEEK_HEAD, c)
		if err != nil {
			if _, ok := err.(Signal); ok {
				log.Println("[info]", err)
			} else {
				log.Println("[error]", err)
			}
			return
		}
	}
}
// InTail follow the tail of file and post BulkMessage to channel.