Added table logging function