// tailFile checks the given file for the given message. It start at the beginning of the file and will return once the string is found. If the string is not yet in the file it will monitor the file and only return once it find the string.
tailFile checks the given file for the given message. It start at the beginning of the file and will return once the string is found. If the string is not yet in the file it will monitor the file and only return once it find the string.
// tailFile checks the given file for the given message . It start at the beginning of the file and will return once the string is found . If the string is not yet in the file it will monitor the file and only return once it find the string .
func tailFile(file, message string, config tail.Config, done chan error) {
	t, err := tail.TailFile(file, config)
	if err != nil {
		log.Println(err)
		done <- err
		return
	}
	for line := range t.Lines {
		if strings.Contains(line.Text, message) {
			done <- nil
		}
	}
	err = t.Wait()
	if err != nil {
		log.Println(err)
		done <- err
	}
}
func tailFile ( file , message string , config tail . Config , done chan error ) { t , err := tail . TailFile ( file , config ) if err != nil { log . Println ( err ) done <- err return } for line := range t . Lines { if strings . Contains ( line . Text , message ) { done <- nil } } err = t . Wait ( ) if err != nil { log . Println ( err ) done <- err } }
tailFile checks the given file for the given message.
tailFile checks the given file for the given message .
// Check if we can find the message we are looking for in the current line