log_targets 0.1.0

Macro for registering log targets to distributed slice with linkme
Documentation
pub use linkme;
use std::panic::Location;

#[linkme::distributed_slice]
pub static LOG_TARGETS: [(&'static str, &Location<'static>)];

#[macro_export]
macro_rules! distributed_log_target {
    () => {
        #[$crate::linkme::distributed_slice($crate::LOG_TARGETS)]
        #[linkme(crate = $crate::linkme)]
        static TARGETS: (&str, &::std::panic::Location<'static>) =
            (::std::module_path!(), ::std::panic::Location::caller());
    };
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_log_target() {
        distributed_log_target!();
    }
}