21 log_goal/1
as log_clause,
33 * @defgroup Log2MD Log Output of Tests in Markdown format.
35 * @ingroup Regression System Tests
37 * These primitives support writing a user-specified log of execution to an
38 * output file. The output file can be used for testing or debugging.
40 * Primitives include the ability to write a title, a Prolog clause or
41 * goal, and hooks for tracing calls. The log_goal/2 can be used to
42 * start a goal. Arguments of the form `<--/2` and `` can be used to
45 * The output format is markdown.
49 open(
F, write,
_Out, [alias(log)]).
58 out(
'## Report on ~a~n~n', [
S]).
67 out(
'### Report on ~a~n~n', [
S]).
75 log_subsection(
S )
:-
76 out(
'#### Report on ~a~n~n', [
S]).
85 out(
'##### Report on ~a~n~n', [
S]).
97 out(
'## Report on ~a~n~n', [
S]).
106 log_goal(
DecoratedClause )
:-
107 take_decorations(
DecoratedClause,
Clause),
111 out(
'~~~~~~~~~n', []).
113 take_decorations(
G,
G )
:-
116 take_decorations(
_ <--
G,
NG )
:-
118 take_decorations(
G,
NG ).
119 take_decorations(
_ <-*
G,
NG )
:-
121 take_decorations(
G,
NG ).
122 take_decorations(
G,
NG )
:-
124 maplist( take_decorations,
Args,
NArgs ),
127 :- meta_predicate (
+ <--
0 ),
143 out(
'succeded as~n'),
log_goal(
Goal)
162 out(
'succeded as~n'),
178 format( log,
Format,
Args),
179 format( user_error,
Format,
Args).
182 format( log,
Format, []),
183 format( user_error,
Format, []).
185 outln(
Format,
Args)
:-
186 out(
Format,
Args),
out(
'~n').
188 out(
Format),
out(
'~n').
log_unit( +String, + Level )
maplist( 2:Pred, + List1,+ List2)