Macro cmd_lib::cmd_die

source ·
cmd_die!() { /* proc-macro */ }
Expand description

Log a fatal message at the error level, and exit process.

e.g:

let file = "bad_file";
cmd_die!("could not open file: $file");
// output:
// [ERROR] FATAL: could not open file: bad_file

format should be string literals, and variable interpolation is supported. Note that this macro is just for convenience. The process will exit with 1 and print “FATAL: …” messages to error console. If you want to exit with other code, you should probably define your own macro or functions.