From cf927ec298125e319392cc164f079fb3b1d43f4f Mon Sep 17 00:00:00 2001 From: Rowan Cannaday Date: Fri, 24 Sep 2021 14:25:45 -0400 Subject: [PATCH] replace env_logger w/ syslog & log_panic this is due to output as documented in following github issue: https://github.com/rusterlium/rustler/issues/335 currently uses USER syslog facility --- Cargo.toml | 3 ++- rs_src/lib.rs | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 56ebc9a..79533cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,4 +16,5 @@ rustler = "0.22.0" once_cell = "1.8.0" cc_mt = { git = "https://github.com/jrmuizel/cc-mt" } log = "0.4.14" -env_logger = "0.9.0" +syslog = "^4.0" +log-panics = "2.0.0" diff --git a/rs_src/lib.rs b/rs_src/lib.rs index f49e9b3..b821f6b 100644 --- a/rs_src/lib.rs +++ b/rs_src/lib.rs @@ -1,10 +1,15 @@ mod schema; mod ebqn; use rustler::{Env,Term}; +use syslog::{Facility, Error}; +extern crate log_panics; pub fn load(env: Env, _info: Term) -> bool { rustler::resource!(schema::Env, env); - env_logger::init(); + syslog::init(Facility::LOG_USER, + log::LevelFilter::Debug, + Some("ebqn")); + log_panics::init(); true } rustler::init!("ebqn", [ebqn::init_st,ebqn::tests],load=load);