samer@6
|
1 :- module(conf_debug, [ tmon/0 ]).
|
samer@6
|
2 :- use_module(library(debug)).
|
samer@6
|
3
|
samer@6
|
4 /** <module> Set options for development
|
samer@6
|
5
|
samer@6
|
6 This module make ClioPatria more suitable for development. In
|
samer@6
|
7 particular, it implements the following methods:
|
samer@6
|
8
|
samer@6
|
9 * Load library(http/http_error), which causes uncaught Prolog
|
samer@6
|
10 exceptions to produce an HTML page holding a stack-trace.
|
samer@6
|
11 * Load library(semweb/rdf_portray), which prints RDF resources
|
samer@6
|
12 in a more compact way.
|
samer@6
|
13 * Load library(semweb/rdf_db) into the module =user=. This allows
|
samer@6
|
14 usage of rdf/3, rdf_load/1, etc. from the toplevel without
|
samer@6
|
15 specifying the module.
|
samer@6
|
16 * Use debug/1 on the _topic_ http(request), which causes the
|
samer@6
|
17 toplevel to print basic information on the HTTP requests processed.
|
samer@6
|
18 Using copy/paste of the HTTP path, one can assemble a command that
|
samer@6
|
19 edits the implementation of a page.
|
samer@6
|
20
|
samer@6
|
21 ==
|
samer@6
|
22 ?- edit('/http/path/to/handler').
|
samer@6
|
23 ==
|
samer@6
|
24 * Define tmon/0 that brings up a graphical tool showing thread
|
samer@6
|
25 activity.
|
samer@6
|
26
|
samer@6
|
27 @see http://www.swi-prolog.org/howto/http/Developing.html
|
samer@6
|
28 */
|
samer@6
|
29
|
samer@6
|
30 :- use_module(library(http/http_error)). % Print stack on error
|
samer@6
|
31 :- use_module(library(semweb/rdf_portray)). % Print e.g., rdf:type
|
samer@6
|
32 :- use_module(user:library(semweb/rdf_db)). % Allow ?- rdf(S,P,O). in toplevel
|
samer@6
|
33
|
samer@6
|
34 :- debug_message_context(+time). % Add time to debug message
|
samer@6
|
35 %:- debug(http(request)). % Print request and reply
|
samer@6
|
36
|
samer@6
|
37 %% prepare_editor
|
samer@6
|
38 %
|
samer@6
|
39 % Start XPCE as edit requests comming from the document server can
|
samer@6
|
40 % only be handled if XPCE is running.
|
samer@6
|
41
|
samer@6
|
42 prepare_editor :-
|
samer@6
|
43 current_prolog_flag(editor, pce_emacs), !,
|
samer@6
|
44 start_emacs.
|
samer@6
|
45 prepare_editor.
|
samer@6
|
46
|
samer@6
|
47 :- prepare_editor.
|
samer@6
|
48
|
samer@6
|
49 %% tmon
|
samer@6
|
50 %
|
samer@6
|
51 % Show the graphical thread-monitor. Can be useful to examine and
|
samer@6
|
52 % debug active goals.
|
samer@6
|
53
|
samer@6
|
54 tmon :-
|
samer@6
|
55 call(prolog_ide(thread_monitor)).
|