From b1bd4e8863a7d0a9a1caa04ac31fca47194c2bf7 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 22 Dec 2018 17:44:18 -0800 Subject: [PATCH] modules: Use the apropos matrix logger for various log messages. --- modules/m_presence.cc | 8 ++++---- modules/m_receipt.cc | 8 ++++---- modules/m_room.cc | 4 ++-- modules/m_room_aliases.cc | 2 +- modules/m_room_canonical_alias.cc | 2 +- modules/m_room_create.cc | 2 +- modules/m_room_history_visibility.cc | 2 +- modules/m_room_join_rules.cc | 2 +- modules/m_room_member.cc | 4 ++-- modules/m_room_message.cc | 2 +- modules/m_room_power_levels.cc | 4 ++-- modules/m_typing.cc | 10 +++++----- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/m_presence.cc b/modules/m_presence.cc index 2cb070568..920d0b43c 100644 --- a/modules/m_presence.cc +++ b/modules/m_presence.cc @@ -70,7 +70,7 @@ catch(const std::exception &e) { log::derror { - "Presence from %s :%s", + m::log, "Presence from %s :%s", json::get<"origin"_>(event), e.what(), }; @@ -90,7 +90,7 @@ try { log::dwarning { - "Ignoring %s from %s for user %s", + m::log, "Ignoring %s from %s for user %s", at<"type"_>(event), at<"origin"_>(event), string_view{user_id} @@ -158,7 +158,7 @@ try log::info { - "%s %s is %s and %s %zd seconds ago", + m::log, "%s %s is %s and %s %zd seconds ago", at<"origin"_>(event), string_view{user_id}, json::get<"currently_active"_>(object)? "active"_sv : "inactive"_sv, @@ -170,7 +170,7 @@ catch(const m::error &e) { log::error { - "Presence from %s :%s :%s", + m::log, "Presence from %s :%s :%s", json::get<"origin"_>(event), e.what(), e.content diff --git a/modules/m_receipt.cc b/modules/m_receipt.cc index 3a0722a54..044798921 100644 --- a/modules/m_receipt.cc +++ b/modules/m_receipt.cc @@ -75,7 +75,7 @@ handle_m_receipt(const m::room::id &room_id, log::dwarning { - "Unhandled m.receipt type '%s' to room '%s'", + m::log, "Unhandled m.receipt type '%s' to room '%s'", type, string_view{room_id} }; @@ -142,7 +142,7 @@ try { log::dwarning { - "ignoring m.receipt m.read for unknown %s in %s for %s", + m::log, "ignoring m.receipt m.read for unknown %s in %s for %s", string_view{user_id}, string_view{room_id}, string_view{event_id} @@ -196,7 +196,7 @@ try log::info { - "%s read by %s in %s @ %zd", + m::log, "%s read by %s in %s @ %zd", string_view{event_id}, string_view{user_id}, string_view{room_id}, @@ -207,7 +207,7 @@ catch(const std::exception &e) { log::derror { - "failed to save m.receipt m.read for %s in %s for %s :%s", + m::log, "failed to save m.receipt m.read for %s in %s for %s :%s", string_view{user_id}, string_view{room_id}, string_view{event_id}, diff --git a/modules/m_room.cc b/modules/m_room.cc index 792d3c089..d77a4da4b 100644 --- a/modules/m_room.cc +++ b/modules/m_room.cc @@ -645,7 +645,7 @@ head__reset(const m::room &room) { log::derror { - "Invalid event '%s' idx %lu in head for %s", + m::log, "Invalid event '%s' idx %lu in head for %s", string_view{event_id}, event_idx, string_view{room.room_id} @@ -724,7 +724,7 @@ dagree_histogram(const m::room &room, { log::warning { - "Event '%s' had %zu prev events (ignored)", + m::log, "Event '%s' had %zu prev events (ignored)", string_view(at<"event_id"_>(event)) }; diff --git a/modules/m_room_aliases.cc b/modules/m_room_aliases.cc index 67a02f051..a07be910a 100644 --- a/modules/m_room_aliases.cc +++ b/modules/m_room_aliases.cc @@ -52,7 +52,7 @@ _changed_aliases(const m::event &event, log::info { - "Updated aliases of %s by %s in %s [%s] => %s", + m::log, "Updated aliases of %s by %s in %s [%s] => %s", string_view{room_id}, json::get<"sender"_>(event), json::get<"event_id"_>(event), diff --git a/modules/m_room_canonical_alias.cc b/modules/m_room_canonical_alias.cc index 9a1514477..a08d14c2a 100644 --- a/modules/m_room_canonical_alias.cc +++ b/modules/m_room_canonical_alias.cc @@ -49,7 +49,7 @@ _changed_canonical_alias(const m::event &event, log::info { - "Changed canonical alias of %s to %s by %s with %s => %s", + m::log, "Changed canonical alias of %s to %s by %s with %s => %s", string_view{room_id}, string_view{alias}, json::get<"sender"_>(event), diff --git a/modules/m_room_create.cc b/modules/m_room_create.cc index 94b220cca..98728b1b6 100644 --- a/modules/m_room_create.cc +++ b/modules/m_room_create.cc @@ -108,7 +108,7 @@ _created_room(const m::event &event, log::debug { - "Creation of room %s by %s (%s)", + m::log, "Creation of room %s by %s (%s)", string_view{room_id}, at<"sender"_>(event), at<"event_id"_>(event) diff --git a/modules/m_room_history_visibility.cc b/modules/m_room_history_visibility.cc index 3cc4d3b29..06b0f03ab 100644 --- a/modules/m_room_history_visibility.cc +++ b/modules/m_room_history_visibility.cc @@ -142,7 +142,7 @@ _changed_visibility(const m::event &event, { log::info { - "Changed visibility of %s to %s by %s => %s", + m::log, "Changed visibility of %s to %s by %s => %s", json::get<"room_id"_>(event), json::get<"content"_>(event).get("history_visibility"), json::get<"sender"_>(event), diff --git a/modules/m_room_join_rules.cc b/modules/m_room_join_rules.cc index b98c82687..c51c42119 100644 --- a/modules/m_room_join_rules.cc +++ b/modules/m_room_join_rules.cc @@ -61,7 +61,7 @@ _changed_rules_notify(const m::event &event, { log::info { - "%s changed join_rules in %s [%s] to %s", + m::log, "%s changed join_rules in %s [%s] to %s", json::get<"sender"_>(event), json::get<"room_id"_>(event), json::get<"event_id"_>(event), diff --git a/modules/m_room_member.cc b/modules/m_room_member.cc index 8648d4048..22d2c841f 100644 --- a/modules/m_room_member.cc +++ b/modules/m_room_member.cc @@ -64,7 +64,7 @@ _can_join_room(const m::event &event, if(join_rule != "invite") log::dwarning { - "Unsupported join_rule '%s' for room %s. Defaulting to 'invite'.", + m::log, "Unsupported join_rule '%s' for room %s. Defaulting to 'invite'.", join_rule, string_view{room.room_id} }; @@ -78,7 +78,7 @@ _can_join_room(const m::event &event, if(membership && membership != "leave") log::dwarning { - "Unsupported membership state '%s' for %s in room %s.", + m::log, "Unsupported membership state '%s' for %s in room %s.", membership, string_view{sender}, string_view{room.room_id} diff --git a/modules/m_room_message.cc b/modules/m_room_message.cc index 472cc56c7..dbc345073 100644 --- a/modules/m_room_message.cc +++ b/modules/m_room_message.cc @@ -27,7 +27,7 @@ _message_notify(const m::event &event, log::info { - "%s said %s in %s %s :%s%s", + m::log, "%s said %s in %s %s :%s%s", json::get<"sender"_>(event), json::get<"event_id"_>(event), json::get<"room_id"_>(event), diff --git a/modules/m_room_power_levels.cc b/modules/m_room_power_levels.cc index 874b4e650..42d97c651 100644 --- a/modules/m_room_power_levels.cc +++ b/modules/m_room_power_levels.cc @@ -68,7 +68,7 @@ _has_power(const m::event &event, if(!power(sender, "events", type, state_key)) log::warning //TODO: throw { - "Power violation %s in %s for %s %s,%s", + m::log, "Power violation %s in %s for %s %s,%s", string_view{sender}, string_view{room_id}, string_view{event_id}, @@ -110,7 +110,7 @@ _changed_levels(const m::event &event, { log::info { - "%s changed power_levels in %s [%s]", + m::log, "%s changed power_levels in %s [%s]", json::get<"sender"_>(event), json::get<"room_id"_>(event), json::get<"event_id"_>(event) diff --git a/modules/m_typing.cc b/modules/m_typing.cc index 940a85e59..687930b41 100644 --- a/modules/m_typing.cc +++ b/modules/m_typing.cc @@ -174,7 +174,7 @@ _handle_edu_m_typing(const m::event &event, { log::dwarning { - "Ignoring %s from %s for user %s", + m::log, "Ignoring %s from %s for user %s", at<"type"_>(event), at<"origin"_>(event), string_view{user_id} @@ -196,7 +196,7 @@ _handle_edu_m_typing(const m::event &event, { log::dwarning { - "Ignoring %s from %s for user %s because not in room '%s'", + m::log, "Ignoring %s from %s for user %s because not in room '%s'", at<"type"_>(event), at<"origin"_>(event), string_view{user_id}, @@ -217,7 +217,7 @@ _handle_edu_m_typing(const m::event &event, log::info { - "%s %s %s typing in %s", + m::log, "%s %s %s typing in %s", at<"origin"_>(event), string_view{user_id}, json::get<"typing"_>(edu)? "started"_sv : "stopped"_sv, @@ -311,7 +311,7 @@ timeout_timeout(const typist &t) log::debug { - "Typing timeout for %s in %s", + m::log, "Typing timeout for %s in %s", string_view{t.user_id}, string_view{t.room_id} }; @@ -417,7 +417,7 @@ update_state(const m::typing &object) log::debug { - "Typing %s in %s now[%b] was[%b] xmit[%b]", + m::log, "Typing %s in %s now[%b] was[%b] xmit[%b]", string_view{at<"user_id"_>(object)}, string_view{at<"room_id"_>(object)}, json::get<"typing"_>(object),