Coder Social home page Coder Social logo

Comments (5)

gaborcsardi avatar gaborcsardi commented on June 11, 2024 1

OK, log levels are now supported. all and the -package notation are not yet. I'll open separate issues for those.

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

I have just discovered your package and I am already a big fan !

Thanks!

Do you know the Smart::Comment perl package ?
It uses the same kind of approach, using comments instead of string litterals (which you can not since R discards them in parsed code).

Yeah, that's why I am using string literals.

You set the level of the debugging by the number of '#', eg.
### is a level 1 debug
#### is a level2 debug
and you can select the debugging level at execution time using the Smart_Comment env var, e.g.
Smart_Comment=###:#### ./my_script.pl
which I think is nice since when you want to debug a script, you do not a priori know which packages it uses (can be indirect), so selecting the package via DEBUG_ME might not be the most convenient approach.
What do you think ?

I thinks these are great ideas! AFAICT there are two possible improvements that we could make. One is setting the debug level of the messages, the way you propose. I would you exclamation marks, so that it is compatible with the current syntax:

"!DEBUG level 1"
...
"!!DEBUG level 2"
etc.

The other is auto-debugging. TBH I am not sure if this is useful enough in practice, because most packages do not use debugme. But I can imagine two improvements for it:

  • setting DEBUGME="all" would debug all packages (that support debugme, obviously). Maybe we can also have an "all packages except these" syntax.
  • adding a function that queries which packages use debugme, so you'll have a rough idea what kind of messages to expect.

What do you think?

from debugme.

kforner avatar kforner commented on June 11, 2024

[I've updated my previous post]

I agree with the ! to indicate the debugging level.

as I wrote, maybe just DEBUGME=":1" to turn on debugging level 1 for all packages ?

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

Cool. Yeah, basically we just need to work out a good syntax now. I see your point about DEBUGME=":1". I like the explicit DEBUGME="all" as well. So how about sg like this:

DEBUGME="pkg1,pkg2"
DEBUGME="!!pkg1,pkg2"
DEBUGME="all"
DEBUGME="!!!all"
DEBUGME="all,-except1,-except2"
DEBUGME="!!!all,-except1"

from debugme.

kforner avatar kforner commented on June 11, 2024

looks good !

from debugme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.