openzeppelin_relayer::logging

Function space_based_rolling

Source
pub fn space_based_rolling(
    file_path: &str,
    base_file_path: &str,
    date_str: &str,
    max_size: u64,
) -> String
Expand description

Checks if the given log file exceeds the maximum allowed size (in bytes). If so, it appends a sequence number to generate a new file name. Returns the final log file path to use.

  • file_path: the initial time-based log file path.
  • base_file_path: the original base log file path.
  • date_str: the current date string.
  • max_size: maximum file size in bytes (e.g., 1GB).