ch32-rs / wlink

An open source WCH-Link library/command line tool written in Rust.
Apache License 2.0
155 stars 25 forks source link

Ensure consistent nanosecond precision in log timestamps #64

Closed liyang8246 closed 2 months ago

liyang8246 commented 2 months ago

Updated the time formatting to always display nanoseconds with three digits in the log output

Before

2024-05-22 22:52:08.540236200 +08:00: loop...
2024-05-22 22:52:09.539918200 +08:00: loop...
2024-05-22 22:52:09.540122 +08:00: loop...
2024-05-22 22:52:09.540406500 +08:00: loop...
2024-05-22 22:52:09.540730400 +08:00: loop...

After

2024-05-22 22:52:44.606: loop...
2024-05-22 22:52:44.607: loop...
2024-05-22 22:52:44.607: loop...
2024-05-22 22:52:44.608: loop...
2024-05-22 22:52:45.617: loop...

This is my first time trying a pull request. I'm not sure if I'm doing it right. QAQ