Switeck wrote:So I replaced that with
log(testCounter+" = testCounter");
...and still nothing was logged!
But this worked:
log(0,testCounter+" = testCounter");
...to which I ask why?!
That is because with only one parameter there is no messageClass defined and the
log()
method defaults the following messageClass:
script.debug.message
This class inherits the settings from the metaclass:
scriptDebugOn
In
logControl.plist
you can define what classes must be logged. I think
scriptDebugOn
is off by default. Setting it to yes will give you output to the logfile.
But when you define your own messageClass, it is probably not defined in logControl and than it will be logged. If you want you can even suppress logging for your messageClasses by adding then to logControl.plist . And as Ahruman mentions a few message above you can also set the logging on the fly. e.g. typing:
Code: Select all
console.setDisplayMessagesInClass("script.debug.message", true)
in the console will make sure you get logging from
log()
commands without a massageClass defined, no matter how it was defined in
logcontrol.plist
. (At least during the current session)
Adding a '0' in front just makes that you create a messageClass '0'. Than a more descriptive name is more useful. I normally use 'this.name' so that I don't have to think about a name and the scriptname is used. When the logs are also mend for user feedback a more descriptive name could be better.
But I agree, to be really useful this should al be documented or most is forgotten in a few weeks from now.
I now added some additional info with the log() command in the wiki.