Deadline 6 LogInfo error

I’m currently in the process of translating all my pre/post job scripts to work in Deadline 6 but I’ve run into a problem. Whenever I try to log something using LogInfo I get the error “NameError: global name ‘LogInfo’ is not defined”. I noticed there are two entries for LogInfo in the script reference, so I tried them both like this:

from Deadline.Events import *

def __main__(*args):
	DeadlineEventListener.LogInfo('Test')

and

from Deadline.Plugins import *

def __main__(*args):
	DeadlinePlugin.LogInfo('Test')

Both of those gave me the error “TypeError: No method matches given arguments”, but the script reference says that they take a single string argument. Am I missing something really obvious here? Is there a new way to call LogInfo in Deadline 6 that I’m just not seeing?

Hello,

LogInfo is a member of the object class so you need to do this in Deadline 6:

self.LogInfo( "test" )

Note you also have available:

self.LogStdout( “this is some boring STD out from the application type of message” )
self.LogWarning( “this is a warning message” )

which might be useful if you want to distinguish between certain messages.

The resulting output would then look like this:

2013-09-10 09:22:34: INFO: test 2013-09-10 09:22:34: STDOUT: this is some boring STD out from the application type of message 2013-09-10 09:22:34: WARNING: this is a warning message

Hope this helps,
Mike

Ah, I see. Thank you.

That worked for my events, but in the context of pre/post task scripts there is no object. It’s just:

def __main__( *args ):
    ...
    #do something!
    ...

Is there still a way to log info in the pre/post task scripts?

As it’s CPython in Deadline now, I guess you could do this:

print ( "%s" % "hello world" )

You can also use ScriptUtils.LogText, which should be available everywhere