The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
RayKelly
2 years agoNew Contributor
Where Is Console.WriteLine Written To
I am debugging some business rules. I would like to add a Console.WriteLine, but I am not sure where that gets written to. I would like to avoid clogging up "Error Logs" and a simple MsgBox is not ...
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