How to set print depth in traceback?

According to the current_prolog_page/2 documentation, debug output has max_depth(10). But this doesn’t look like max_depth(10) in the traceback:

ERROR: /tmp/swipl_17715_313.fqn-ast.pl:169:
	Unknown error term: goal_failed(maplist_kyfact_symrej/8, pykythe:2082)
	In:
	 [138] throw(error(goal_failed(..., ...), _116))
	 [136] pykythe:maplist_eval_assign_expr([assign(..., ...), ...|...], [json{fact_name:'/kythe/node/kind', fact_value:'YW5jaG9y', source: ...}, ...|...], [], sym_rej(symtab{<17 items>...}, []), sym_rej(_290, _292), meta{'test-corpus', 'test-root', '/usr/lib/python3.7/test/support/testresult.py', '.usr.lib.python3:7.test.support.testresult', ...}) at /home/peter/src/pykythe/pykythe/pykythe.pl:2074
	 [135] pykythe:maplist_eval_assign_expr([stmt(assign), ...|...], [json{fact_name:'/kythe/node/kind', fact_value:'YW5jaG9y', source: ...}, ...|...], [], sym_rej(symtab{<17 items>...}, []), sym_rej(_522, _524), meta{'test-corpus', 'test-root', '/usr/lib/python3.7/test/support/testresult.py', '.usr.lib.python3:7.test.support.testresult', ...}) at /home/peter/src/pykythe/pykythe/pykythe.pl:2074

I tried adding these to my code, but they didn’t make any difference:

    set_prolog_flag(debugger_write_options, [quoted(true), portray(true), max_depth(30), attributes(portray), spacing(next_argument)]),
    set_prolog_flag(print_write_options, [quoted(true), portray(true), max_depth(30), attributes(portray), spacing(next_argument)]),

Exception backtraces are shallow copies. They are controlled by several flags in library(prolog_stack). See that file for details.

set_prolog_flag(backtrace_goal_depth, 10) got me the details that I craved. Thank-you.

(It might also be necessary to add :- use_module(library(prolog_stack)).)

1 Like

I don’t think it is. The library uses the code below. The keep(true) means “do not set this flag if it is already defined”. The library itself is loaded when needed.

:- create_prolog_flag(backtrace_goal_depth, 3,    [type(integer), keep(true)]).