Functions Index :: D :: DebugLog

[<< up one level]

Module:

debug :: logging

Definition:

DebugLog(int debug_level, string format, val "p01", val "p02", val "p03", val "p04", ..., val "p50" )

Description:

Outputs debuging information in a log file [1].

If the supplied debug_level is >= current debug mode (level) the function uses StrPrint() to insert the values of any defined variable arguments (p01, , p50) into the string format and write it to the log file using WriteFileEnd. Else the function does nothing.

Examples:

fmt = "Processed clip is %i frames long, %ix%i and %f fps."

c = AVISource()

SetDebugMode(2)

# this equals to a NOP (1 > 2)

DebugLog(1, fmt, c.FrameCount, c.Width, c.Height, c.Framerate)

# this will output to log file

DebugLog(2, fmt, c.FrameCount, c.Width, c.Height, c.Framerate)

 

[<< top]

 


[1]:The main use of DebugLog is to trace the values of variables and function / filter arguments during code execution by carefully placing calls to DebugLog inside script code.

Descriptive format strings (for example ones that name the function, the variable, etc) greatly help the interpretation of log file contents.