move get_err_string() to libdg_dbg
add loop config framework