$Account.OrganizationName
ACE News and Tips Newsletter Helping You Make the Most of ACE
July 2006

Welcome to the July 2006 edition of Riverace's ACE News and Tips newsletter. This issue contains a FAQ about ACE_DEBUG and ACE_ERROR and a reminder about the upcoming How to Use ACE Effectively class (Sign up by September 1 to ensure you get the $200 discount!!!).

In this issue
  • Featured Book: C++ Network Programming, Volume 2 (C++NPv2)
  • FAQ: ACE_DEBUG vs. ACE_ERROR
  • Next "How to Use ACE Effectively" Class: October 17-20, 2006

  • FAQ: ACE_DEBUG vs. ACE_ERROR

    A Frequently-Asked-Question (FAQ) about ACE's logging macros is "What's the difference between ACE_DEBUG and ACE_ERROR? Can I use LM_DEBUG severity with ACE_ERROR and vice-versa?" Riverace's support customers can see the answer to this and other ACE FAQs in the support Knowledge Base. Everyone else will have to keep reading...

    The difference between ACE_DEBUG and ACE_ERROR is what happens to the calling thread's ACE_Log_Msg instance's op_status indicator. ACE_ERROR sets op_status to -1; ACE_DEBUG sets it to 0.

    op_status is sometimes used to tell what the status of the most recent ACE call was. This can be most helpful when detecting if there was an error in a constructor, which can't return a value. For example:

    ACE_INET_Addr bad ("bad.address.given");
    if (ACE_LOG_MSG::op_status () == -1)
      // take error action
    

    op_status can be accessed directly via ACE_LOG_MSG::op_status (), as above, and it can also be inserted into a log message using the %R logging directive.

    This scheme relies on the method in question setting op_status() before return; inside of ACE, this is most often done by using the ACE_ERROR macro when an error occurs. Even if the particular logging severity is disabled, op_status will still be set, unless logging macros are defined to no-ops via the ACE_NLOGGING configuration macro (see APG chapter 3 for details).

    As we see above, there are some significant drawbacks to using op_status as a serious error detection facility. It relies on methods using ACE_ERROR to set the status, and is disabled completely when ACE_NLOGGING is set. It's much better to use value-returning methods in ACE and exceptions in your application code.

    So what's the recommended use for ACE_ERROR and ACE_DEBUG in your code? The best way to use them is as indicators to readers of your code that an error is, or isn't, being reported.


    Next "How to Use ACE Effectively" Class: October 17-20, 2006

    Have you ever felt like screaming when faced with the ACE Reference Documentation? We can help sort it all out and get you programming with ACE like a pro! We've scheduled an open enrollment How to Use ACE Effectively class for October 17-20, 2006 in Waltham, MA (in the Boston area). This is a new expanded 4-day class, priced at US$1,700 (discounted to $1500 for online enrollments by September 1) including continental breakfast, snacks and lunch each day. Each attendee receives a copy of the class slides and a copy of The ACE Programmer's Guide (one of the authors, Steve Huston, will be teaching the class and would be happy to sign anyone's book.

    For more information and to sign up, please click on the "October 17-20, 2006" link at our training page. You'll also find a PDF file for multiple enrollments and for payment other than by credit card. That form is also available here.

    Also, please note that attendees get a 10% savings on ACE Annual Support purchased when you pay for your class! Take advantage of this opportunity to make the most of your new ACE knowledge and keep the momentum going back at the office with quick answers and direction on your project's issues!


    Featured Book: C++ Network Programming, Volume 2 (C++NPv2)

    Now in its fourth printing, this widely acclaimed book covers the major frameworks in ACE, how and why they're designed as they are, and examples for how to use them. This books also contains an in-depth coverage of reuse techniques over what this newsletter discusses, and a domain analysis of the factors often encountered when designing networked applications. Every serious ACE user should have this book on their desk at all times.

    Buy it now from amazon.com...
    Quick Links...

    ACE Documentation

    ACE 5.4 Series Kits

    Latest ACE 5.5 Kit

    ACE Training Classes

    ACE Support Services

    Newsletter Archive

    More About Us



    Join our mailing list!
    phone: 888-384-8154