2 stable releases
1.1.0 | Sep 27, 2024 |
---|---|
1.0.0 | Jan 11, 2024 |
#1648 in Network programming
204 downloads per month
6KB
91 lines
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();
}
Dependencies
~0.9–1.8MB
~38K SLoC