mintrt 0.1.0

Security-featured runtime for lua.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//     <<*>> Revenge of snowflake.
//     -^v-  SASWE
//     @ This source code is licensed under a dual license model:
//       1. MPL-2.0 for non-commercial use only
//       2. Commercial License for commercial use
//       See LICENSE and LICENSE_COMMERCIAL files for details.

pub fn panic_hook() {
    std::panic::set_hook(Box::new(|panic_info| {
        log::error!("panic! detail: {}", panic_info);
        println!("{}", panic_info);
        //因为rust panic的退出代码为101,所以服务启动器(popen)能够注意到错误并提示用户处理
        // 成功覆盖掉之前的hook
    }));
}

/* 所以,我若还能复苏,会有人等我吗? */