Slashdot Mirror


Printf Debugging Revisited

gsasha writes "After long nights spent in debugging, w e have developed a C++ logging facility geared for debugging - and an article that describes our debugging methodology. The article consists of two parts: the first one describes the basics of the method, and the second one presents advanced techniques (to be completed if there is enough reader interest).
Happy debugging!"

5 of 59 comments (clear)

  1. Instead of adverts for 2nd-year student projects by devphil · · Score: 4, Informative


    why not a link to a more professional and better-designed debugging library instead? The author has made insane efforts to handle all kinds of error conditions which it looks like these kids haven't even thought of.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  2. Don't reinvent the wheel by pyrrhonist · · Score: 3, Informative
    Don't reinvent the wheel. These facilities already handle logging better:
    --
    Show me on the doll where his noodly appendage touched you.
  3. Why is this on Slashdot at all? by Anonymous Coward · · Score: 5, Informative

    As many have said, this has been done before. One of their main macros isn't even correct. Ie.,

    #define LOG(logger) if ((logger).is_active()) (logger).os()

    This will break if one writes:

    if (value == 0)
    LOG(xxx) "hello" endl;
    else ...

    The "else" gets interpreted as being attached to the "if" inside the LOG macro when it shouldn't.

    It should be written as:

    #define LOG(logger) if (!(logger).is_active()) ; else (logger).os()

    For a much more expansive trace/log system see OSE at:

    http://ose.sourceforge.net

    and specifically

    http://ose.sourceforge.net/browse.php?group=librar y-manual&entry=logger.htm

    and

    http://ose.sourceforge.net/browse.php?group=librar y-manual&entry=tracer.htm

    The OSE library has had this stuff for over ten years now.

  4. My own thoughts by Anonymous Coward · · Score: 1, Informative

    As many other, I once wrote quite an extensive logging library.

    You can find it here along with an article I wrote what I though logging should support:

    http://www.bluefish.se/aquarium/lime.html

  5. PURE EVIL by Viking+Coder · · Score: 4, Informative

    // Constructor:
    Logger(const Logger& enable2 = *(Logger*)0);


    (Trimmed to trick the lameness filter.)

    Pure. Evil.

    And don't go telling me "that's perfectly valid," cause you know what? I don't care if the C++ compiler accepts it, and I don't care if you do it in your code. That is just pure evil.

    --
    Education is the silver bullet.