Log debug instead of trace for timestamp index inserts.
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build was killed Details

This commit is contained in:
projectmoon 2020-11-10 20:35:27 +00:00
parent 551f21a49a
commit af197dd58f
1 changed files with 5 additions and 7 deletions

View File

@ -135,12 +135,10 @@ mod timestamp_index {
let parts: Vec<&[u8]> = key.split(|&b| b == 0xff).collect();
if let [room_id, event_id] = parts[..] {
let event_id = str::from_utf8(event_id)?;
debug!("Adding event ID {} to timestamp index", event_id);
let mut ts_key = room_id.to_vec();
ts_key.push(0xff);
ts_key.extend_from_slice(&timestamp_bytes);
trace_index_record(room_id, event_id, &timestamp_bytes);
log_index_record(room_id, event_id, &timestamp_bytes);
hashset_tree::add_to_set(roomtimestamp_eventid, &ts_key, event_id.to_owned())?;
Ok(())
@ -149,10 +147,10 @@ mod timestamp_index {
}
}
/// Log a trace message.
fn trace_index_record(room_id: &[u8], event_id: &[u8], timestamp: &[u8]) {
if log_enabled!(log::Level::Trace) {
trace!(
/// Log a debug message.
fn log_index_record(room_id: &[u8], event_id: &[u8], timestamp: &[u8]) {
if log_enabled!(log::Level::Debug) {
debug!(
"Recording event {} | {} received at {} in timestamp index.",
str::from_utf8(room_id).unwrap_or("[invalid room id]"),
str::from_utf8(event_id).unwrap_or("[invalid event id]"),