summaryrefslogtreecommitdiff
path: root/src/mattermost
diff options
context:
space:
mode:
Diffstat (limited to 'src/mattermost')
-rw-r--r--src/mattermost/client.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mattermost/client.rs b/src/mattermost/client.rs
index 861e0a8..2172338 100644
--- a/src/mattermost/client.rs
+++ b/src/mattermost/client.rs
@@ -15,6 +15,11 @@ pub struct Client {
bearer_token: Option<String>,
client: reqwest::Client,
}
+impl std::fmt::Debug for Client {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("Client").field("url", &self.url).finish()
+ }
+}
#[async_trait::async_trait]
pub trait Handler {
@@ -26,10 +31,10 @@ pub trait Handler {
}
impl Client {
- pub(crate) fn new(auth: AuthData, url: &str) -> Self {
+ pub(crate) fn new(auth: AuthData, url: String) -> Self {
Self {
auth,
- url: url.to_owned(),
+ url,
bearer_token: None,
client: reqwest::Client::new(),
}
@@ -90,6 +95,7 @@ impl Client {
match json {
Ok(websocketmessage) => {
if let WebsocketMessage::Update(update) = websocketmessage {
+ debug!("Handling update {:?}", update);
if let Err(err) = handler.handle(update, &self).await {
warn!("Handler returned error: {err}");
}