How to enable debug prints

Duktape 1.x

Logs will be written to stderr.

Duktape 2.x

Example of DUK_USE_DEBUG_WRITE in manually edited duk_config.h:

#define DUK_USE_DEBUG_WRITE(level,file,line,func,msg) do { \
        fprintf(stderr, "D%ld %s:%d (%s): %s\n", \
                (long) (level), (file), (long) (line), (func), (msg));
    } while (0)

Same function as an argument to tools/configure.py:

'-DDUK_USE_DEBUG_WRITE(level,file,line,func,msg)=do {fprintf(stderr, "D%ld %s:%ld (%s): %s\n", (long) (level), (file), (long) (line), (func), (msg));} while(0)'