Add debugging function and debugging output to trade base module