add trace function to logging