Jump to content
Sign in to follow this  
torstenanders

Disabling do-verbose

Recommended Posts

Is there perhaps any way to switch off all those trace prints created by very many Opusmodus functions.  Here is an example: I want to get rid of printout(s) before the actual result.

OM> (pitch-transpose 2 '(q c4))
pitch-transpose, transpose: 2 ambitus: PIANO section: NIL exclude: NIL
(Q D4)

These constant traces are problematic for me, because in all those prints I very easily miss printouts that are particularly important (e.g., warnings from some functions). 

 

I am aware of the Opusmodus function do-verbose. I would very much like to avoid adding do-verbose to my own functions.

 

On the contrary, I am asking for a way to globally switch off what do-verbose does in other functions, e.g., by some global variable. That should be easy to implement (e.g., in the definition of do-verbose, if that global variable is set to NIL, no printing happens). 

 

Besides, if I really want some trace of function calls, this is actually already build-in into Common Lisp in a way that can be switched on and off selectively for any function with trace.

 

BTW: The example shown at HyperSpec (http://clhs.lisp.se/Body/m_tracec.htm) does not quite work as expected in CCL, because CCL cleverly inlines all the recursive calls, but that can also be switched off (see https://trac.clozure.com/ccl/wiki/DebugWithOpenmcl). Besides, CCL offers also an extended version of trace (https://ccl.clozure.com/manual/chapter4.2.html). Further, I usually need traces during debugging, and Common Lisp IDEs usually provide even interactive backtraces (e.g., not only the arguments of functions, but also values of local variables within the lexical scope of functions can be seen, changed, and used in arbitrary test evaluations). I guess that such facilities have been purposefully disabled in Opusmodus, because such power can initially confuse new users.

 

EDIT: basically, what I want to do is ensure that the internal function %do-verbose does not do anything if it is switched off, like so. 

(defparameter *do-verbose?* T "Enable or disable traces printed by do-verbose.")

(defun %do-verbose (<args>)
  (when *do-verbose?*
    <put-orig-def-here>))

 I cannot add this definition myself because I do not have the original code of this definition, and because the definition of this function is protected and cannot easily be overwritten by users.

 

I should perhaps add that I appreciate that the do-verbose traces can be useful for getting the seed of some function call for "freezing" some result one might like. However, for me this usefulness still does not mean this feature should be switched on all the time. 

 

Thanks! 

Share this post


Link to post
Share on other sites

In the next version you will be able to disable the DO-VERBOSE macro:

(defparameter *do-verbose* nil "Enable or disable traces printed by do-verbose.")

 

Share this post


Link to post
Share on other sites

Perhaps – if others would also find such control useful – some checkbox could also be added to the preferences, e.g., under Appearance > Listener. Anyway, only if this is relevant for other users...

 

Thanks again!

 

Best,

Torsten

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...