diff --git a/IOB-WIN-NEXT/IobGeneric.cs b/IOB-WIN-NEXT/IobGeneric.cs
index 09689216..deb4b133 100644
--- a/IOB-WIN-NEXT/IobGeneric.cs
+++ b/IOB-WIN-NEXT/IobGeneric.cs
@@ -3634,7 +3634,7 @@ namespace IOB_WIN_NEXT
if (utils.CRB("enableContapezzi"))
{
// rilettura contapezzi da server...
- lgInfo("Ciclo VLF: pzCntReload(true)");
+ lgTrace("Ciclo VLF: pzCntReload(true)");
if (!isMulti)
{
pzCntReload(true);
diff --git a/IOB-WIN-NEXT/IobOpcUa.cs b/IOB-WIN-NEXT/IobOpcUa.cs
index dd69ee5b..97882859 100644
--- a/IOB-WIN-NEXT/IobOpcUa.cs
+++ b/IOB-WIN-NEXT/IobOpcUa.cs
@@ -734,7 +734,7 @@ namespace IOB_WIN_NEXT
int vFactor = 2;
if (vetoCheckStatus < adesso)
{
- lgDebug($"Stato variabili checkPing: {testPingMachine}");
+ lgTrace($"Stato variabili checkPing: {testPingMachine}");
// imposto veto per vetoSeconds...
vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor);
}
diff --git a/IOB-WIN-NEXT/IobOpcUaCMS.cs b/IOB-WIN-NEXT/IobOpcUaCMS.cs
index b7b27bf0..4a0eb835 100644
--- a/IOB-WIN-NEXT/IobOpcUaCMS.cs
+++ b/IOB-WIN-NEXT/IobOpcUaCMS.cs
@@ -194,10 +194,10 @@ namespace IOB_WIN_NEXT
// faccio preliminarmente upsertKey...
upsertKey(currMem.name, currMem.value);
serObj = JsonConvert.SerializeObject(item);
- lgInfo($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}");
- lgInfo($"---------------{Environment.NewLine}UPDATED PARAM:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
+ lgDebug($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}");
+ lgDebug($"---------------{Environment.NewLine}UPDATED PARAM:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
serObj = JsonConvert.SerializeObject(currMem);
- lgInfo($"---------------{Environment.NewLine}MEMORY CONTENT:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
+ lgDebug($"---------------{Environment.NewLine}MEMORY CONTENT:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
switch (currMem.tipoMem)
{
@@ -252,12 +252,12 @@ namespace IOB_WIN_NEXT
}
else
{
- lgInfo($"Errore: memAddrWrite vuoto!");
+ lgError($"Errore: memAddrWrite vuoto!");
}
}
else
{
- lgInfo($"Errore uid non trovato in area write memory: {item.uid}, ci sono {memMap.mMapWrite.Count} in area write");
+ lgError($"Errore uid non trovato in area write memory: {item.uid}, ci sono {memMap.mMapWrite.Count} in area write");
}
}
catch (Exception exc)
diff --git a/IOB-WIN-NEXT/UAClient.cs b/IOB-WIN-NEXT/UAClient.cs
index bafcc513..cc101a59 100644
--- a/IOB-WIN-NEXT/UAClient.cs
+++ b/IOB-WIN-NEXT/UAClient.cs
@@ -185,7 +185,7 @@ namespace IOB_WIN_NEXT
{
eh_MonItChange(this, new opcUaMonitItemChange(monitoredItem, notification));
}
- lgDebug($"Notification Received | Variable: {monitoredItem.DisplayName} | Value: {notification.Value}");
+ lgTrace($"Notification Received | Variable: {monitoredItem.DisplayName} | Value: {notification.Value}");
}
catch (Exception ex)
{
@@ -224,10 +224,16 @@ namespace IOB_WIN_NEXT
protected void lgDebug(string message)
{
lg.Factory.Configuration.Variables["codIOB"] = currIob;
- //if (isLogVerbose)
- //{
lg.Info(message);
- //}
+ }
+ ///
+ /// Effettua logging TRACE corretto impostanto anche la variabile IOB prima di scrivere...
+ ///
+ ///
+ protected void lgTrace(string message)
+ {
+ lg.Factory.Configuration.Variables["codIOB"] = currIob;
+ lg.Trace(message);
}
#endregion Protected Methods
@@ -261,15 +267,15 @@ namespace IOB_WIN_NEXT
NodeId nodeToBrowse = new NodeId(startNodeVal, startNodeNS);
// Call Browse service
- lgInfo($"Browsing {nodeToBrowse} node...");
+ lgTrace($"Browsing {nodeToBrowse} node...");
ReferenceDescriptionCollection browseResults = browser.Browse(nodeToBrowse);
// Display the results
- lgInfo($"Browse returned {browseResults.Count} results:");
+ lgTrace($"Browse returned {browseResults.Count} results:");
foreach (ReferenceDescription result in browseResults)
{
- lgDebug($" NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}");
+ lgTrace($" NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}");
// se NON fa parte dell'elenco dei VETO di filterItems...
if (!vetoBrowse.Contains($"{result.NodeId}"))
{
@@ -318,23 +324,23 @@ namespace IOB_WIN_NEXT
NodeId nodeToBrowse = new NodeId(browsePath);
// Call Browse service
- lgInfo($"Browsing {nodeToBrowse} node...");
+ lgTrace($"Browsing {nodeToBrowse} node...");
ReferenceDescriptionCollection browseResults = browser.Browse(nodeToBrowse);
// Display the results
- lgInfo($"Browse returned {browseResults.Count} results:");
+ lgTrace($"Browse returned {browseResults.Count} results:");
foreach (ReferenceDescription result in browseResults)
{
// se veto --> loggo veto
if (vetoBrowse.Contains($"{result.NodeId}"))
{
- lgDebug($"| FILTERED --> NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}");
+ lgTrace($"| FILTERED --> NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}");
}
// se NON fa parte dell'elenco dei VETO di filterItems...
else
{
- lgDebug($" NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}");
+ lgTrace($" NodeId = {result.NodeId}, DisplayName = {result.DisplayName.Text}, NodeClass = {result.NodeClass}, Others: {result.BinaryEncodingId} | {result.BrowseName}");
// se mancasse aggiungo...
if (!nodeIdNameList.ContainsKey($"{result.NodeId}"))
{
@@ -449,7 +455,7 @@ namespace IOB_WIN_NEXT
catch (Exception ex)
{
// Log Error
- lgInfo($"Create Session Error : {ex.Message}");
+ lgError($"Create Session Error : {ex.Message}");
return false;
}
}
@@ -474,7 +480,7 @@ namespace IOB_WIN_NEXT
}
else
{
- lgInfo("Session not created!");
+ lgError("Session not created!");
}
}
catch (Exception ex)
@@ -603,7 +609,7 @@ namespace IOB_WIN_NEXT
// Display the results.
foreach (DataValue result in resultsValues)
{
- lgDebug($"Read Value = {result.Value} , StatusCode = {result.StatusCode}");
+ lgTrace($"Read Value = {result.Value} , StatusCode = {result.StatusCode}");
}
#endregion Read a node by calling the Read Service
@@ -611,10 +617,10 @@ namespace IOB_WIN_NEXT
#region Read the Value attribute of a node by calling the Session.ReadValue method
// Read Server NamespaceArray
- lgInfo("Reading Value of NamespaceArray node...");
+ lgTrace("Reading Value of NamespaceArray node...");
DataValue namespaceArray = m_session.ReadValue(Variables.Server_NamespaceArray);
// Display the result
- lgInfo($"NamespaceArray Value = {namespaceArray}");
+ lgTrace($"NamespaceArray Value = {namespaceArray}");
#endregion Read the Value attribute of a node by calling the Session.ReadValue method
}