onCheckLog and onCheckLogLine not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • 18th November 2015 at 4:20 pm #14557

    Hello,

    it seems that in my templates (I’m using pretty much the defaults for maya vray and cinema4d) the MTemplateAPI.MTemplate overrides onCheckLogLine and onCheckLog are not called at all (or do not work). OnCheckExitCode seems to work, because I can see the “Exit code * differs from expected 0 value” in the Chunks detail results but although my log looks like this:

    Code:

    Asset Error: X:sometexture.jpg (Mat)
    Rendering failed: Asset missing
    [MUSTER]Process terminated with exit code: 2

    and the onCheckLogLine and onCheckLog look like this:

    Code:
    def onCheckLogLine(self, job, chunk, clientTemplatePreferences, logLine):
    return self.onCheckLog(job, chunk, clientTemplatePreferences, logLine)

    def onCheckLog(self,job,chunk,clientTemplatePreferences,log):
    if log.lower().find(“warning”) != -1:
    return MTemplateAPI.MTemplateError(2,”Warning keyword found”,MTemplateAPI.MTemplateError.kTemplateErrorTypeWarning)
    if log.lower().find(“error”) != -1:
    return MTemplateAPI.MTemplateError(1,”Error keyword found”,MTemplateAPI.MTemplateError.kTemplateErrorTypeError)
    if log.find(“Rendering successful:”) == -1:
    return MTemplateAPI.MTemplateError(3,”Missing “Rendering successful:” keyword. Batch render may have crashed”,MTemplateAPI.MTemplateError.kTemplateErrorTypeWarning)

    return MTemplateAPI.MTemplateError()

    I never get warnings or errors from these, even if I disable onCheckExitCode temporarily.

    19th November 2015 at 9:27 am #15273

    I made some progress, but I still can’t get it to work. No debug messages, no onCheckLog..

    In Dispatcher Preferences > Logs and exit codes, I enabled Logs warnings > Enable Check and Logs errors > Enable check, and under Logs I set Redirect templates python output to: Logs.

    To debug the templates, I used python’s print() as well as the following snippet to try to debug my templates, though still I can’t see any output.

    Code:
    def write_log(self, msg):
    try:
    import MDispatcherAPI
    MDispatcherAPI.logAddMessage(msg)
    except:
    pass
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.