mirror of
https://codeberg.org/slatian/service.echoip-slatecave.git
synced 2025-07-23 01:06:04 +02:00
Use the log create instead of println
This commit is contained in:
@ -18,6 +18,7 @@ use governor::{
|
||||
RateLimiter,
|
||||
state::keyed::DefaultKeyedStateStore,
|
||||
};
|
||||
use log::debug;
|
||||
|
||||
use std::net::IpAddr;
|
||||
use std::num::NonZeroU32;
|
||||
@ -55,10 +56,10 @@ pub async fn rate_limit_middleware(
|
||||
if limiter.check_key(&IpAddr::V4(std::net::Ipv4Addr::UNSPECIFIED)).is_ok() {
|
||||
let oldlen = limiter.len();
|
||||
if oldlen > 100 {
|
||||
println!("Doing limiter cleanup ...");
|
||||
debug!("Doing limiter cleanup ...");
|
||||
limiter.retain_recent();
|
||||
limiter.shrink_to_fit();
|
||||
println!("Old limiter store size: {oldlen} New limiter store size: {}", limiter.len());
|
||||
debug!("Old limiter store size: {oldlen} New limiter store size: {}", limiter.len());
|
||||
}
|
||||
}
|
||||
next.run(req).await
|
||||
|
Reference in New Issue
Block a user