From d186099afede52316789502ee9bb8b14db5dd914 Mon Sep 17 00:00:00 2001
From: Alina Hagan <alina-hagan@outlook.com>
Date: Sat, 10 Aug 2024 00:10:15 +0100
Subject: [PATCH] Some tuning, cleaned up extraneous error! macros, some INFO's
 downgraded to DEBUG's

---
 src/error.rs     |  2 --
 src/ls_client.rs | 12 ++++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/error.rs b/src/error.rs
index fdec096..0888818 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -7,7 +7,6 @@ pub struct IllegalArgumentException(String);
 
 impl IllegalArgumentException {
     pub fn new(msg: &str) -> IllegalArgumentException {
-        error!(msg);
         IllegalArgumentException(msg.to_string())
     }
 }
@@ -31,7 +30,6 @@ pub struct IllegalStateException {
 
 impl IllegalStateException {
     pub fn new(msg: &str) -> IllegalStateException {
-        error!(msg);
         IllegalStateException {
             details: msg.to_string(),
         }
diff --git a/src/ls_client.rs b/src/ls_client.rs
index a496743..f4f72db 100644
--- a/src/ls_client.rs
+++ b/src/ls_client.rs
@@ -355,8 +355,8 @@ impl LightstreamerClient {
                                     //
                                     "conok" => {
                                         if let Some(session_id) = submessage_fields.get(1).as_deref() {
-                                            self.make_log( Level::INFO, &format!("Session creation confirmed by server: {}", clean_text) );
-                                            self.make_log( Level::INFO, &format!("Session created with ID: {:?}", session_id) );
+                                            self.make_log( Level::DEBUG, &format!("Session creation confirmed by server: {}", clean_text) );
+                                            self.make_log( Level::DEBUG, &format!("Session created with ID: {:?}", session_id) );
                                             //
                                             // Subscribe to the desired items.
                                             //
@@ -443,10 +443,10 @@ impl LightstreamerClient {
                                         // Don't do anything with these notifications for now.
                                     },
                                     "probe" => {
-                                        self.make_log( Level::INFO, &format!("Received probe message from server: {}", clean_text ) );
+                                        self.make_log( Level::DEBUG, &format!("Received probe message from server: {}", clean_text ) );
                                     },
                                     "reqok" => {
-                                        self.make_log( Level::INFO, &format!("Received reqok message from server: '{}'", clean_text ) );
+                                        self.make_log( Level::DEBUG, &format!("Received reqok message from server: '{}'", clean_text ) );
                                     },
                                     //
                                     // Subscription confirmation from server.
@@ -714,7 +714,7 @@ impl LightstreamerClient {
                                         write_stream
                                             .send(Message::Text(format!("create_session\r\n{}\n", encoded_params)))
                                             .await?;
-                                        self.make_log( Level::INFO, &format!("Sent create session request: '{}'", encoded_params) );
+                                        self.make_log( Level::DEBUG, &format!("Sent create session request: '{}'", encoded_params) );
                                     },
                                     unexpected_message => {
                                         return Err(Box::new(std::io::Error::new(
@@ -744,7 +744,7 @@ impl LightstreamerClient {
                             )));
                         },
                         None => {
-                            self.make_log( Level::INFO, "No more messages from server" );
+                            self.make_log( Level::DEBUG, "No more messages from server" );
                             break;
                         },
                     }