package behave.models;

import behave.execution.ExecutionContext;
import behave.tools.Log;

/**
 * This is the default LeafNode implementation which does nothing.
 * Create some actual logic by extending this class and use other nodes to create the tree.
 */
public abstract class LeafNode implements Node {
    @Override
    public void initialize(ExecutionContext context) {}

    @Override
    public void addChild(Node node) {
        throw new RuntimeException("Leaf node cannot have children");
    }

    /**
     * These two nodes are just for debugging. Always implement your own.
     */

    public static class SucceedingLeafNode extends LeafNode {
        @Override
        public Types.Status tick(ExecutionContext context) {
            Log.debug("I will always succeed");
            return Types.Status.Success;
        }
    }

    public static class FailingLeafNode extends LeafNode {
        @Override
        public Types.Status tick(ExecutionContext context) {
            Log.debug("I will always fail");

            return Types.Status.Failure;
        }
    }

}

package behave.models;

import behave.execution.ExecutionContext;
import behave.tools.Log;

/**
 * This is the default LeafNode implementation which does nothing.
 * Create some actual logic by extending this class and use other nodes to create the tree.
 */
public abstract class LeafNode implements Node {
    @Override
    public void initialize(ExecutionContext context) {}

    @Override
    public void addChild(Node node) {
        throw new RuntimeException("Leaf node cannot have children");
    }

    /**
     * These two nodes are just for debugging. Always implement your own.
     */

    public static class SucceedingLeafNode extends LeafNode {
        @Override
        public Types.Status tick(ExecutionContext context) {
            Log.info("I will always succeed");
            return Types.Status.Success;
        }
    }

    public static class FailingLeafNode extends LeafNode {
        @Override
        public Types.Status tick(ExecutionContext context) {
            Log.info("I will always fail");

            return Types.Status.Failure;
        }
    }

}

--- 
+++ 
@@ -23,7 +23,7 @@
     public static class SucceedingLeafNode extends LeafNode {
         @Override
         public Types.Status tick(ExecutionContext context) {
-            Log.info("I will always succeed");
+            Log.debug("I will always succeed");
             return Types.Status.Success;
         }
     }
@@ -31,7 +31,7 @@
     public static class FailingLeafNode extends LeafNode {
         @Override
         public Types.Status tick(ExecutionContext context) {
-            Log.info("I will always fail");
+            Log.debug("I will always fail");
 
             return Types.Status.Failure;
         }
Reduce some log-spam to debug-level
