samer@6: :- module(conf_debug, [ tmon/0 ]). samer@6: :- use_module(library(debug)). samer@6: samer@6: /** Set options for development samer@6: samer@6: This module make ClioPatria more suitable for development. In samer@6: particular, it implements the following methods: samer@6: samer@6: * Load library(http/http_error), which causes uncaught Prolog samer@6: exceptions to produce an HTML page holding a stack-trace. samer@6: * Load library(semweb/rdf_portray), which prints RDF resources samer@6: in a more compact way. samer@6: * Load library(semweb/rdf_db) into the module =user=. This allows samer@6: usage of rdf/3, rdf_load/1, etc. from the toplevel without samer@6: specifying the module. samer@6: * Use debug/1 on the _topic_ http(request), which causes the samer@6: toplevel to print basic information on the HTTP requests processed. samer@6: Using copy/paste of the HTTP path, one can assemble a command that samer@6: edits the implementation of a page. samer@6: samer@6: == samer@6: ?- edit('/http/path/to/handler'). samer@6: == samer@6: * Define tmon/0 that brings up a graphical tool showing thread samer@6: activity. samer@6: samer@6: @see http://www.swi-prolog.org/howto/http/Developing.html samer@6: */ samer@6: samer@6: :- use_module(library(http/http_error)). % Print stack on error samer@6: :- use_module(library(semweb/rdf_portray)). % Print e.g., rdf:type samer@6: :- use_module(user:library(semweb/rdf_db)). % Allow ?- rdf(S,P,O). in toplevel samer@6: samer@6: :- debug_message_context(+time). % Add time to debug message samer@6: %:- debug(http(request)). % Print request and reply samer@6: samer@6: %% prepare_editor samer@6: % samer@6: % Start XPCE as edit requests comming from the document server can samer@6: % only be handled if XPCE is running. samer@6: samer@6: prepare_editor :- samer@6: current_prolog_flag(editor, pce_emacs), !, samer@6: start_emacs. samer@6: prepare_editor. samer@6: samer@6: :- prepare_editor. samer@6: samer@6: %% tmon samer@6: % samer@6: % Show the graphical thread-monitor. Can be useful to examine and samer@6: % debug active goals. samer@6: samer@6: tmon :- samer@6: call(prolog_ide(thread_monitor)).