tcp_env_logger

Crates.iotcp_env_logger
lib.rstcp_env_logger
version1.1.0
sourcesrc
created_at2024-01-11 07:09:41.862168
updated_at2024-09-27 05:14:23.249169
descriptionTCP logger built on top of env_logger
homepagehttps://github.com/handle-fi/tcp_env_logger
repositoryhttps://github.com/handle-fi/tcp_env_logger
max_upload_size
id1095955
size6,866
Lorenzo Fontoura (rellfy)

documentation

README

tcp_env_logger

TCP logger built on top of env_logger

Example usage

Note that log_hostname can be any arbitrary value. Its purpose is to identify the server emitting the logs.

log_url is the full TCP socket connection URL.

fn setup_logger() {
    let log_hostname = std::env::var("LOG_LOCAL_HOSTNAME").expect("LOG_LOCAL_HOSTNAME not defined");
    let log_url = std::env::var("LOG_REMOTE_URL").expect("LOG_REMOTE_URL not defined");
    let env_logger = env_logger::Builder::from_default_env().build();
    EnvTcpLogger::init(log_hostname, log_url, env_logger).unwrap();
}
Commit count: 7

cargo fmt