As my custom Optimizer is running, I would like to display progress text messages. This can let the user know when further improvement is unlikely and the optimization can be cancelled. Writing to the Connection and Exception log seems like a possibility. How would I do that? Or is there a better way?
Rename
I would not clog up the Exception log with those messages, because it's unlikely that users would catch them there. I'll add an item in our requested features list for this capability.
I'm the only user. Is there a way to write to the log from the custom Optimizer? I'm guessing not. My (ugly?) workaround is to use a StreamWriter text file that I Flush from time to time. I open the file from NotePad to watch the progress.
WLHost.Instance.AddLogItem
Initially, I was confused until I looked at the documentation, which is listed under IHost (the C# interface to WLHost) as it should be. But since WL automatically creates an instance of IHost, WLHost.Instance, that's what we want to reference in our methods.
Initially, I was searching for WLHost.Instance when I should have been searching for IHost instead. Now I understand.
The AddLogItem() call looks like a useful method. Interesting.
Initially, I was searching for WLHost.Instance when I should have been searching for IHost instead. Now I understand.
The AddLogItem() call looks like a useful method. Interesting.
Yes, we adopted a Singleton pattern here because previously we'd just be passing an instance of this interface all over the place. This cleans up many of the calls. And it allows the "IHost" interface to be accessed from anywhere :)
Perfect for my purpose!
Your Response
Post
Edit Post
Login is required