improve logging

This commit is contained in:
JenneJ 2015-10-12 11:55:39 +02:00
parent 50d8fdc535
commit ce5528a42a
2 changed files with 5 additions and 4 deletions

View File

@ -75,7 +75,7 @@ Module Main
Next
logger.Info("{0} Marks imported", marks.Count)
logger.Info("================================")
logger.Info("=================== DPMA END ===================")
' =========================================================================================
@ -91,6 +91,7 @@ Module Main
' Über mainControlId überprüfen, ob marke vorhanden
Dim markExists As Integer = db.GetRecordId(mainControlId, m.ApplicationNumber)
logger.Debug("Mark {0} exists: {1}", markExists, CBool(markExists))
' Wenn noch nicht vorhanden
If (markExists = 0) Then
@ -123,6 +124,7 @@ Module Main
' Wert aktualisieren
Dim hasChanged As Boolean = Not db.IsEqual(controlId, recordId, value)
logger.Debug("Value {0} for {1} has changed", value, recordId)
If hasChanged Then
db.UpdateValue(controlId, recordId, value)
@ -130,7 +132,7 @@ Module Main
End If
Next
End If
logger.Info("================================")
logger.Info("=================== DATABASE END ===================")
Next
@ -139,7 +141,6 @@ Module Main
logger.Error("An Error occurred: " & ex.Message)
Environment.Exit(1)
End Try
End Sub
End Module

View File

@ -18,7 +18,7 @@
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<target name="logfile" xsi:type="File" fileName="BrainpoolXmlParser.log" />
<target name="logfile" xsi:type="File" fileName="${basedir}/BrainpoolXmlParser-${shortdate}.log" />
<target name="console" xsi:type="Console"/>
<!--