Logs an entry to the storage. If it cannot log the entry, it prints to the canister's logs.
(&self, entry_type: LogEntryType)
| 50 | |
| 51 | /// Logs an entry to the storage. If it cannot log the entry, it prints to the canister's logs. |
| 52 | pub fn log(&self, entry_type: LogEntryType) { |
| 53 | if let Err(err) = self.try_log(entry_type) { |
| 54 | crate::upgrader_ic_cdk::api::print(format!("Failed to log entry: {err}")); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /// Returns logs from the storage starting from the end of the log. |
| 59 | pub fn get_logs(&self, offset: Option<u64>, limit: Option<u64>) -> GetLogsResult { |