pull log and expected functions out to top module top-level