func (r *Rule) Apply(file *File) error {
	r.initLogger()

	ret, err := r.Condition.Evaluate(file)
	if err != nil {
		return err
	}

	if ret {
		r.log.Infof("[%s] - %s", r.Action.Name(), file.Name)
		return r.Action.Execute(file)
	}
	return nil
}
// Apply conditionnaly applies the action.
Apply conditionnaly applies the action.
// Apply conditionnaly applies the action .
func (r *Rule) Apply(file *File) error {
	r.initLogger()
	ret, err := r.Condition.Evaluate(file)
	if err != nil {
		return err
	}
	if ret {
		r.log.Infof("[%s] - %s", r.Action.Name(), file.Name)
		return r.Action.Execute(file)
	}
	return nil
}
func ( r * Rule ) Apply ( file * File ) error { r . initLogger ( ) ret , err := r . Condition . Evaluate ( file ) if err != nil { return err } if ret { r . log . Infof ( " " , r . Action . Name ( ) , file . Name ) return r . Action . Execute ( file ) } return nil }
Apply conditionnaly applies the action.
Apply conditionnaly applies the action .