Page 1 of 1
timerFired not being called
Posted: Mon Jul 21, 2014 11:19 am
by davet2
I'm running a developer licence of Switch12 (not that it should matter for this problem) for Windows, and I can't get the timerFired function to be called.
I've a lot of scripts that use it successfully in Switch11, but now we're looking at upgrading I thought it would be best to test!
Even a very simple function such as this:
function timerFired( s : Switch )
{
s.setTimerInterval(60);
s.log(1,"test");
}
Does nothing when put in a flow (testing in the SwitchScripter application produces the results). Is this a bug or have I missed something in the newest version?
Finally, the 'log debug messages' has been removed - this is a very useful log that we often use to debug issues. Will this be added back?
timerFired not being called
Posted: Mon Jul 21, 2014 3:27 pm
by dkelly
I believe you are resetting the timer each time. Try this:
function timerFired( s : Switch )
{
if (s.getTimerInterval() == 0)
s.setTimerInterval(60);
s.log(1,"test");
}
Dwight Kelly
Apago, Inc.
timerFired not being called
Posted: Tue Jul 22, 2014 9:03 am
by davet2
Thanks for the suggestion, but it still does nothing. There is never any entry in the log with 'test'.
Guess it's a bug then.
timerFired not being called
Posted: Tue Jul 22, 2014 10:08 am
by davet2
Ok, it was being called after all - turns out that the original script I was testing had an error in it. But I couldn't catch the error because the log level 1 doesn't seem to do anything anymore. If I change it to level 2 or 3 then I get my logging to work.
So still a bug, but a smaller one than I previously thought.
timerFired not being called
Posted: Tue Jul 22, 2014 11:36 am
by freddyp
I see you have already found the "solution", but I would still like to send this tardy confirmation (I was away last week): s.log with level 1 and with level -1 does not log anything anymore since Switch 12. This is a result of the fact that we drastically reduced the number of messages being generated by Switch.
So that is how I also do it since: I use level 2 during the testing of the script in a flow (in Switch Scripter level 1 still generates messages) and once I see all is well, I comment out the log lines.
Freddy
timerFired not being called
Posted: Tue Jul 22, 2014 12:42 pm
by davet2
Freddy,
Thanks for the confirmation - it's a shame that the info logging has been removed. I think it should be up to the users to be able to log this or not. I can understand that it doesn't log as much in the main gui but from a system point of view I can't see whats going on (which is a big problem for me and will mean that I won't be upgrading any of our systems). As a sysadmin we need the logs for accountability - users can complain that files didn't get processed/sent and now we have no proof of this.
And the removal of the debug log option is a big step back too.
timerFired not being called
Posted: Fri Jul 25, 2014 9:51 pm
by compendio
Check the
http://www.enfocus.com/en/support/knowl ... switch-12/ and search for "Reduced number of Messages"
timerFired not being called
Posted: Mon Jul 28, 2014 2:12 pm
by davet2
It turns out that all the messages are still being logged, just not shown in the GUI. They're available when outputting the logs to text files (or by looking in the internal log DB) - so now I just get out the logs from the internal DB and put them all in an external MySQL database instead. Really annoying when trying to quickly debug something though.