POV-Ray : Newsgroups : povray.programming : "Clean" debugging : Re: "Clean" debugging Server Time
26 Oct 2025 18:00:32 EDT (-0400)
  Re: "Clean" debugging  
From: Leroy
Date: 23 Oct 2025 14:20:00
Message: <web.68fa70f846e6a89d98e0cf93f712fc00@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> So, I have had to include a lot of output to the debug stream to inspect values
> passed into macros, compare results of macros to tests done in other macros, and
> inspect the code flow so that I can see how the logic of various test results
> get directed.
>
> Doing
> #if (Test)
>      #debug (something)
> #end
>
> clutters the code, is tedious, and if everything is spread out all across the
> code, it is a nightmare to turn on and off.
>
> So what I did was test for a Global_Debug identifier, and if defined, then I
> enable the #debug statements.
>
> I do that by creating a macro called Debug ()
>
> Then everything gets wrapped in Debug ( ), sans the #debug statement.
> Then it's just one line, can be kept in the code, is trivial to turn on and off,
> and all of the #if () #end stuff is in a single tiny macro.
>
> It's simple, and I suppose obvious, but just thought I'd include it here in case
> anyone derives benefit from it.
>
> - BE

How about using debug.inc? It has some of the stuff you talked about. I debug
everything and I normally don't delete a debug but comment it out(never know
when ya might need it again)
Have Fun!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.