Skip to content

Commit

Permalink
removed logging - was used during development for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
GyroGearl00se committed Jun 20, 2024
1 parent 8f8d27f commit 5e376df
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
3 changes: 0 additions & 3 deletions Services/SEMPService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ public async Task<ListenerPorts> 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;
}
}
Expand Down
11 changes: 1 addition & 10 deletions Services/SolacePublishService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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();
Expand Down
6 changes: 0 additions & 6 deletions Services/SolaceSubscribeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand All @@ -68,11 +65,9 @@ public void HandleMessage(object source, MessageEventArgs args, Action<string> 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);
}
}
Expand All @@ -85,7 +80,6 @@ public void HandleMessage(object source, MessageEventArgs args, Action<string> m

public void Disconnect()
{
_logger.LogInformation("Disconnecting session.");
if (_session != null)
{
_session.Disconnect();
Expand Down

0 comments on commit 5e376df

Please sign in to comment.