Hi All,
I am working a project where required geometry and attribute validations of ~ 50 checks.
Each validation status and errors type have to show in console window as well as a log shape file.
I have created log file but unable to console window log.
kindly, help how can achieve the above requirement.
Note : I am working on .net basic command(Extending Arobjects).
It depends how far you want to go with your presentation.
You could create a new form with multiline scrolling text control on it and dump the text in there. This gives you the most control over presentation but is the most development work/maintenance, and allows you to integrate this with your application.
Or if you just want to see the log and don't care about the trimmings, you could simply get the system to use the default application to open the qualified path and filename with
Process.Start(FILE_NAME)
Open a txt file when a button clicked in VB.NET - Stack Overflow
For me this opens the log file with Notepad++, which gives me all the power I could need for most log files. If your log file is in the gigabytes-realm of size, you will need a more heavy-duty solution.
To compliment Andrew Quee's answer it is probably worth looking at this page about logging in VB .NET as this question is more about .NET than ArcObjects.
In VB something like this: Hello World in Visual Basic
Fair call, I'm still learning .NET so I still tend to think along hacky VB6/VBA lines.
That's probably a more elegant solution and I have looked at .NET logging objects before. I didn't mention it because I must have gone a step too far in the docs and the next thing I knew I was knee-deep in ASP, Windows Server and enterprise web server territory looking at listeners and instrumenters, which is imho waaay overkill for looking at a simple log file.
If anyone has a simple class or some sample code for implementing this, that'd be most appreciated.
I don't think you are the first to end up with that overwhelming feeling as you stumble around the world of .NET, I know I regularly do! I would class myself as a desktop developer but as we move towards ArcPro and ArcGIS online I have found the server side stuff a bit bewildering.