Forum Discussion
kenostrovsky
2 years agoNew Contributor III
Hello Ray,
I also find multiple Error Log entries difficult to navigate for debugging purposes.
What I do is declare a class variable that I write all of my log information to from all of the functions and then do a single write to the error log to see the results of the execution. I also add the same BRApi.ErrorLog.LogMessage() statement to the "Catch" clause.
Public log As New Text.StringBuilder
Try
some BR for-loop
log.appendline( "message")
end loop
BRApi.ErrorLog.LogMessage(si, log.ToString)
Catch ex As Exception
' In case of execution error see what has collected in the log so far.
BRApi.ErrorLog.LogMessage(si, log.ToString)
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try