[Ace-users] How to disable DEBUG by logging strategy?

Jim weiping_guo at yahoo.com
Tue Jun 19 10:07:48 CDT 2007


ACE VERSION: 5.5.8

    HOST MACHINE and OPERATING SYSTEM:
        If on Windows based OS's, which version of WINSOCK do you
        use?:

   Windows


    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
    COMPILER NAME AND VERSION (AND PATCHLEVEL):

    THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
    specific file, simply state which one]: win-32

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
    use a link to a platform-specific file, simply state which one
    (unless this isn't used in this case, e.g., with Microsoft Visual
    C++)]:

    CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/
default.features
    (used by MPC when you generate your own makefiles):

    AREA/CLASS/EXAMPLE AFFECTED:
[What example failed?  What module failed to compile?]

    DOES THE PROBLEM AFFECT:
        COMPILATION? NO
        LINKING?
            On Unix systems, did you run make realclean first?
        EXECUTION?
        OTHER (please specify)?
[Please indicate whether ACE, your application, or both are affected.]

    SYNOPSIS:
[Brief description of the problem]
How to disable DEBUG by using Logging Strategy?

    DESCRIPTION:
[Detailed description of problem.  Don't just say "<blah>
doesn't work, here's a fix," explain what your program does
to get to the <blah> state. ]

I have defined the following macro for my project:

	#define TRACE_PREFIX        ACE_TEXT("[%D] [TRACE] ")
#define DEBUG_PREFIX		ACE_TEXT("[%D] [DEBUG] ")
#define INFO_PREFIX			ACE_TEXT("[%D] [INFO] ")
#define NOTICE_PREFIX		ACE_TEXT("[%D] [NOTICE] ")
      #define WARNING_PREFIX		ACE_TEXT("[%D] [WARNING] ")
	.....
And

#define MY_DEBUG(FMT, ...)\
        ACE_DEBUG(( LM_DEBUG, \
                    DEBUG_PREFIX THREAD_PREFIX ACE_TEXT(FMT) \
                    __VA_ARGS__ ))

....

This macro is used in the application for consistence purpose. I want
to control the debug level in the runtime by loading the following
config:

	dynamic Logger Service_Object *
   ACE:_make_ACE_Logging_Strategy()
	"-s log.out -f STDERR|OSTREAM -p INFO|WARN|ERROR|CRITICAL -w"


The event loop is started. However, the debug information is still
output to the log file.

Is anything I did wrong? My application is a heavy multithreaded, is
it has something to do with it?

Any suggestions are apprecatied!



    REPEAT BY:
[What you did to get the error; include test program or session
transcript if at all possible.  ]

    SAMPLE FIX/WORKAROUND:
[If available ]



More information about the Ace-users mailing list