Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
fix: update time formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
doinkythederp committed Dec 8, 2023
1 parent c0b06f8 commit b585117
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pros/examples/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use core::time::Duration;
use pros::prelude::*;
use pros_sys::delay;

#[derive(Debug, Default)]
struct ExampleRobot;
Expand All @@ -11,7 +12,11 @@ impl Robot for ExampleRobot {
pros::logger::ProsLogger::init().unwrap();

let str = "PROS";
info!("Hello, {str}!");
loop {
info!("Hello, {str}!");

sleep(Duration::from_millis(1000));
}

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions pros/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ impl Log for ProsLogger {
let message = format!(
"{}m{}s{}ms [{}] {}: {}",
now.num_minutes(),
now.num_seconds(),
now.num_milliseconds(),
now.num_seconds() % 60,
now.num_milliseconds() % 1000,
record.level(),
target,
record.args()
Expand Down

0 comments on commit b585117

Please sign in to comment.