Replace prints with logs and fix grammar (#437)

* refactor: replace print statements with proper logging and fix grammar

- Fix English grammar errors in existing log messages
- Add tracing imports where needed
- Improve log message clarity and consistency
- Follow project logging best practices using tracing crate

* fix: resolve clippy warnings and format code

- Fix unused import warnings by making test imports conditional with #[cfg(test)]
- Fix unused variable warning by prefixing with underscore
- Run cargo fmt to fix formatting issues
- Ensure all code passes clippy checks with -D warnings flag

* refactor: move tracing::debug import into test module

Move the tracing::debug import from file-level #[cfg(test)] into the test module itself for better code organization and consistency with other test modules

* Checkpoint before follow-up message

Co-authored-by: anzhengchao <anzhengchao@gmail.com>

* refactor: move tracing::debug import into test module in user_agent.rs

Complete the refactoring by moving the tracing::debug import from file-level #[cfg(test)] into the test module for consistency across all test files

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
安正超
2025-08-21 05:49:40 +08:00
committed by GitHub
parent a104c33974
commit 357cced49c
10 changed files with 43 additions and 42 deletions
+2 -1
View File
@@ -110,6 +110,7 @@ pub fn uvarint(buf: &[u8]) -> (u64, isize) {
mod tests {
use super::*;
use tokio::io::BufReader;
use tracing::debug;
#[tokio::test]
async fn test_read_full_exact() {
@@ -130,7 +131,7 @@ mod tests {
rev[total - n..total].copy_from_slice(&buf[..n]);
count += 1;
println!("count: {count}, total: {total}, n: {n}");
debug!("Read progress - count: {}, total: {}, bytes read: {}", count, total, n);
}
assert_eq!(total, size);