elast0ny / shared_memory

A Rust wrapper around native shared memory for Linux and Windows
380 stars 51 forks source link

I cannot use systemd_journal_logger with shared memory #85

Closed vandercijr closed 2 years ago

vandercijr commented 2 years ago

I am not able to use shared_memory lib and systemd_journal_logger lib together when I run binary file without debug symbols

For example

`use log::LevelFilter;

fn main() {
  systemd_journal_logger::init().unwrap();

  log::set_max_level( LevelFilter::Debug);

  log::warn!("A warning.");
  log::error!("An error");
}    `

And this dependencies


`[dependencies]
serde =  { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "=0.4.14"
systemd-journal-logger = "=0.3.1"

everything works perfectly when running ./target/release/xyz

but if I include shared_memory It stops working

I checked in sm source code that implements a log crate, why dont use standard log api implementation ?| thanks

jcaesar commented 2 years ago

Well, there's your problem: https://github.com/elast0ny/shared_memory/pull/81

elast0ny commented 2 years ago

Hi,

(thx @jcaesar ! )

Seems like you're most likely running into a bug from a previous versions (it is hard to tell as you didn't include the shared memory dependency info). Try using the lastest version. If it still fails, we can reopen the issue !

jcaesar commented 2 years ago

most likely running into a bug from a previous version

@elast0ny Hm? crates.io still has 0.12.2, and that does have that problem. Am I missing something?

elast0ny commented 2 years ago

I just pushed 0.12.3, sorry for the delay