From 5e376df934ebda12473c2c806ed8e3d3c5552205 Mon Sep 17 00:00:00 2001 From: GyroGearl00se Date: Thu, 20 Jun 2024 18:12:19 +0200 Subject: [PATCH] removed logging - was used during development for debugging purposes --- Services/SEMPService.cs | 3 --- Services/SolacePublishService.cs | 11 +---------- Services/SolaceSubscribeService.cs | 6 ------ 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/Services/SEMPService.cs b/Services/SEMPService.cs index f093b5e..c42c575 100644 --- a/Services/SEMPService.cs +++ b/Services/SEMPService.cs @@ -131,9 +131,6 @@ public async Task GetListenerAsync(string url, string messageVpn, config.SmfsPort = msgVpnElement.GetProperty("serviceSmfTlsListenPort").GetInt32(); config.SmfsEnabled = msgVpnElement.GetProperty("serviceSempTlsEnabled").GetBoolean(); } - _logger.LogInformation($"SmfsEnabled: {config.SmfsEnabled}"); - _logger.LogInformation($"SmfPort: {config.SmfPort}"); - _logger.LogInformation($"SmfsPort: {config.SmfsPort}"); return config; } } diff --git a/Services/SolacePublishService.cs b/Services/SolacePublishService.cs index 2653694..da0d34f 100644 --- a/Services/SolacePublishService.cs +++ b/Services/SolacePublishService.cs @@ -30,8 +30,6 @@ public void PublishMessage(string host, string vpnName, string username, string ContextFactory.Instance.Init(cfp); _context = ContextFactory.Instance.CreateContext(new ContextProperties(), null); - _logger.LogInformation("Connect task started for publishing."); - _logger.LogInformation("sslVerify: " + sslVerify); SessionProperties sessionProps = new SessionProperties() { Host = host, @@ -49,7 +47,6 @@ public void PublishMessage(string host, string vpnName, string username, string throw new Exception("Failed to connect to Solace broker."); } - _logger.LogInformation("PublishMessage task started."); using (IMessage msg = ContextFactory.Instance.CreateMessage()) { msg.Destination = ContextFactory.Instance.CreateTopic(topic); @@ -64,18 +61,12 @@ public void PublishMessage(string host, string vpnName, string username, string } finally { - if (_session != null) - { - _logger.LogInformation("Disconnecting publish session."); - _session.Disconnect(); - _session.Dispose(); - } + Disconnect(); } } public void Disconnect() { - _logger.LogInformation("Disconnecting session."); if (_session != null) { _session.Disconnect(); diff --git a/Services/SolaceSubscribeService.cs b/Services/SolaceSubscribeService.cs index 8b00449..6259d93 100644 --- a/Services/SolaceSubscribeService.cs +++ b/Services/SolaceSubscribeService.cs @@ -33,11 +33,9 @@ public void SubscribeToTopic(string host, string vpnName, string username, strin if (_session != null) { - _logger.LogInformation("Disconnecting previous session."); Disconnect(); } - _logger.LogInformation("Connect task started for subscribing."); SessionProperties sessionProps = new SessionProperties() { Host = host, @@ -54,7 +52,6 @@ public void SubscribeToTopic(string host, string vpnName, string username, strin { throw new Exception("Failed to connect to Solace broker."); } - _logger.LogInformation("SubscribeToTopic task started."); _session.Subscribe(ContextFactory.Instance.CreateTopic(topic), true); } catch (OperationErrorException ex) @@ -68,11 +65,9 @@ public void HandleMessage(object source, MessageEventArgs args, Action m { try { - _logger.LogInformation("Received published message."); using (IMessage message = args.Message) { string messageContent = Encoding.ASCII.GetString(message.BinaryAttachment); - _logger.LogInformation("Message content: {0}", messageContent); messageHandler(messageContent); } } @@ -85,7 +80,6 @@ public void HandleMessage(object source, MessageEventArgs args, Action m public void Disconnect() { - _logger.LogInformation("Disconnecting session."); if (_session != null) { _session.Disconnect();