I was going through the Help and looking at the state machine use of a logger and thought that could be a helpful function. There are times that, rather than perhaps savings the states as they occur - I might want to write the value of variables, etc.
I created a simple state machine (image link below) to test the logger example. I am assuming (as the great body of evidence will show) - that I am stoopit. This state machine reflects that.
In the initial state I set a counter and then use the example code from the help to create my logger. So far, so good. Although I do have a question - is something supposed to happen with logger.Show()? I don't see anything in the console - should I be looking in the windows event viewer?
The in the next state I simply take a random shot - 90% I'm probably stoopit, else... maybe not - in this code snippet below.
if (this.stoopitChance <= 90) {
logger.log("You are so stoopit")
} else {
logger.log("Still stoopit... but the help could be better")
}
However, when I hit this instance of logger.log, an error is reflected in the simulation window:
[214175784] SIMULATION ERROR: logger is undefined Expression: // chances are I'm stoopit - check if we are - log the result
Do I need to create a new COMObject? I would think not. That begs the question, how do I refer to my already instantiated COMObject?
And of course - where is the log?
How would I change this to say, write to a local text file?
https://imgur.com/DtkrdCTThanks all!