fix noneffective of "--debug" option
change default log level to WARN
custom exit status code without effecting middleware mode