pub fn recovery_info(&self, info_level: u32) -> String {
        let mut i = 1;
        let mut _cidx = 1;
        let mut log_cnt = HashMap::<String, u64>::new();
        let mut curr = self.pages;
        let mut pgs = vec![];
        while let Some(page) = curr.as_option() {
            if info_level > 2 {
                pgs.push(format!("  page {:<3} at offset {:x} (len = {}, full = {})", i, page.off(), page.len, page.is_full()));
            }

            #[cfg(feature = "pin_journals")] {
                if self.current == *page {
                    _cidx = i;
                }
            }

            for log in page.into_iter() {
                let entry = log_cnt.entry(log.kind()).or_default();
                *entry += 1;
                if info_level > 3 && log != LogEnum::None {
                    pgs.push(format!("    {:?}", log));
                }
            }

            i += 1;
            curr = page.next;
        }

        let mut total_logs = 0;
        let mut logs_indv = vec![];
        for (kind, count) in log_cnt {
            if kind != "None" {
                total_logs += count;
            }
            if info_level > 1 {
                logs_indv.push(format!("  {:<16} {}", kind, count));
            }
        }

        let mut res = format!("Committed: {}\n", 
            if self.is_committed() { "Yes" } else { "No" });
        res += &format!("Chaperoned session id: {}\n", self.sec_id);
        res += &format!("Chaperone file: {}\n", String::from_utf8(self.chaperon.to_vec()).unwrap_or("".to_string()));
        res += &format!("Number of pages: {}\n", i-1);

        #[cfg(feature = "pin_journals")] {
            res += &format!("current page at offset {:x} (index = {})", self.current.off(), _cidx);
        }

        res += &format!("Number of logs: {}\n", total_logs);
        if info_level > 1 {
            for ln in logs_indv {
                res += &format!("{}\n", ln);
            }
        }

        if info_level > 2 {
            res += "Contents:\n";
            for ln in pgs {
                res += &format!("{}\n", ln);
            }
        }

        res
    }
/// Returns a string containing the logging information
Returns a string containing the logging information
Returns a string containing the logging information
pub fn recovery_info(&self, info_level: u32) -> String {
        let mut i = 1;
        let mut _cidx = 1;
        let mut log_cnt = HashMap::<String, u64>::new();
        let mut curr = self.pages;
        let mut pgs = vec![];
        while let Some(page) = curr.as_option() {
            if info_level > 2 {
                pgs.push(format!("  page {:<3} at offset {:x} (len = {}, full = {})", i, page.off(), page.len, page.is_full()));
            }
            #[cfg(feature = "pin_journals")] {
                if self.current == *page {
                    _cidx = i;
                }
            }
            for log in page.into_iter() {
                let entry = log_cnt.entry(log.kind()).or_default();
                *entry += 1;
                if info_level > 3 && log != LogEnum::None {
                    pgs.push(format!("    {:?}", log));
                }
            }
            i += 1;
            curr = page.next;
        }
        let mut total_logs = 0;
        let mut logs_indv = vec![];
        for (kind, count) in log_cnt {
            if kind != "None" {
                total_logs += count;
            }
            if info_level > 1 {
                logs_indv.push(format!("  {:<16} {}", kind, count));
            }
        }
        let mut res = format!("Committed: {}\n", 
            if self.is_committed() { "Yes" } else { "No" });
        res += &format!("Chaperoned session id: {}\n", self.sec_id);
        res += &format!("Chaperone file: {}\n", String::from_utf8(self.chaperon.to_vec()).unwrap_or("".to_string()));
        res += &format!("Number of pages: {}\n", i-1);
        #[cfg(feature = "pin_journals")] {
            res += &format!("current page at offset {:x} (index = {})", self.current.off(), _cidx);
        }
        res += &format!("Number of logs: {}\n", total_logs);
        if info_level > 1 {
            for ln in logs_indv {
                res += &format!("{}\n", ln);
            }
        }
        if info_level > 2 {
            res += "Contents:\n";
            for ln in pgs {
                res += &format!("{}\n", ln);
            }
        }
        res
    }
pub fn recovery_info ( & self , info_level : u32 ) -> String { let mut i = 1 ; let mut _cidx = 1 ; let mut log_cnt = HashMap :: < String , u64 > :: new ( ) ; let mut curr = self . pages ; let mut pgs = vec ! [ ] ; while let Some ( page ) = curr . as_option ( ) { if info_level > 2 { pgs . push ( format ! ( " " i page off ( ) page len page is_full ( ) ) ) ; } # [ cfg ( feature " " ) ] { if self . current == * page { _cidx = i ; } } for log in page . into_iter ( ) { let entry = log_cnt . entry ( log . kind ( ) ) . or_default ( ) ; * entry += 1 ; if info_level > 3 && log != LogEnum :: None { pgs . push ( format ! ( " " log ) ) ; } } i += 1 ; curr = page . next ; } let mut total_logs = 0 ; let mut logs_indv = vec ! [ ] ; for ( kind , count ) in log_cnt { if kind != " " { total_logs += count ; } if info_level > 1 { logs_indv . push ( format ! ( " " kind count ) ) ; } } let mut res = format ! ( " \n " if self is_committed ( ) { " " } else { " " } ) ; res += & format ! ( " \n " self sec_id ) ; res += & format ! ( " \n " String from_utf8 ( self chaperon to_vec ( ) ) unwrap_or ( " " to_string ( ) ) ) ; res += & format ! ( " \n " i 1 ) ; # [ cfg ( feature " " ) ] { res += & format ! ( " " self current off ( ) _cidx ) ; } res += & format ! ( " \n " total_logs ) ; if info_level > 1 { for ln in logs_indv { res += & format ! ( " \n " ln ) ; } } if info_level > 2 { res += " \n " ; for ln in pgs { res += & format ! ( " \n " ln ) ; } } res }
Returns a string containing the logging information
Returns a string containing the logging information
&self
info_level
u32