Skip to content

Commit

Permalink
Update Configuration.md and time.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Bryan Conn <30739012+bconn98@users.noreply.github.com>
  • Loading branch information
Dirreke and bconn98 committed Jan 31, 2024
1 parent 875a3d1 commit bda2a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ unit is not specified), case does not matter:
- month[s]
- year[s]

> Note: `log4j` set `Sunday` as the first day of the week, but `log4rs` set
> `Monday` as the first day of the week, which is the same as `chrono` crate
> and the `ISO 8601` standard. So if you use `week`, the log file will be rolled
> Note: `log4j` treats `Sunday` as the first day of the week, but `log4rs` treats
> `Monday` as the first day of the week, which is the follows the `chrono` crate
> and the `ISO 8601` standard. So when using `week`, the log file will be rolled
> on `Monday` instead of `Sunday`.
The _modulate_ field is an optional boolean. It indicates whether the interval should
Expand Down Expand Up @@ -254,7 +254,7 @@ However, be warned that the roller renames every file when a log rolls over.
Having a large count value can negatively impact performance.

> Note: If you use the `triger: time`, the log file will be rolled before it
> gets written, which ensure that the logs are rolled in the correct position
> gets written, which ensures that the logs are rolled in the correct position
> instead of leaving a single line of logs in the previous log file. However,
> this may cause a substantial slowdown if the `background` feature is not enabled.
Expand Down
2 changes: 1 addition & 1 deletion src/append/rolling_file/policy/compound/trigger/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ mod test {
];
let modulate = false;
for (time_trigger_interval, time_in_milli) in test_list.iter() {
MockClock::set_system_time(Duration::from_millis(4 * day_in_milli)); // Sunday
MockClock::set_system_time(Duration::from_millis(4 * day_in_milli)); // 1970/1/5 00:00:00 Monday
assert_eq!(
trigger_with_time_and_modulate(*time_trigger_interval, modulate, *time_in_milli),
(false, true)
Expand Down

0 comments on commit bda2a00

Please sign in to comment.