Add two utility functions to dump logs on error and emr step summary