comp.soft-sys.ace
[Top] [All Lists]
Try out TrashMail.net disposable email address service

About ACE_Logging_Strategy

Subject: About ACE_Logging_Strategy
From: joe
Date: Fri, 11 Jul 2008 01:51:48 -0700 PDT
Newsgroups: comp.soft-sys.ace

ACE VERSION: 5.6
HOST MACHINE and OPERATING SYSTEM:    winxp
COMPILER NAME AND VERSION (AND PATCHLEVEL): g++
THE $ACE_ROOT/ace/config.h FILE : #include "ace/config-win32.h"
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU

I have define a class like this:
Event_Handler : public ACE_Event_Handler{
        ...
        virtual int handle_timeout(const ACE_Time_Value &, const void *arg);
        ...
}

ACE_TMAIN :
...
ACE_TCHAR file[200];
sprintf(file, "dynamic Debug_Level Service_Object *
ACEVC8:_make_ACE_Logging_Strategy() \" -s r.log -f STDERR|OSTREAM -p
DEBUG|INFO|ERROR -w\"");
if (ACE_Service_Config::process_directive (file) != 0) {
        ACE_ERROR ((LM_ERROR,
                ACE_TEXT ("(%P|%t) Service_Config_DLL::svc() - ")
                ACE_TEXT ("process_directive() failed for:\n")
                ACE_TEXT ("\"%s\"\n"),
                file));
} else {
        ACE_DEBUG ((LM_INFO,
                ACE_TEXT ("(%P|%t) Service_Config_DLL::svc() - ")
                ACE_TEXT ("process_directive() success for:\n")
                ACE_TEXT ("\"%s\"\n"),
                file));
}

Event_Handler handler;
handler.reactor(ACE_Reactor::instance ());

ACE_Time_Value initialDelay(3);
ACE_Time_Value interval(10);
long handler_timerId = ACE_Reactor::instance ()-
>schedule_timer(&handler, 0, initialDelay, interval);
ACE_UNUSED_ARG(handler_timerId);
...


in Event_Handler::handle_timeout judge Directory Changes(examples
\Reactor\WFMO_Reactor) or not,
if changed:
...
ACE_Service_Config::process_directive ("remove Debug_Level");
ACE_TCHAR new_file[200];
sprintf(new_file, "dynamic Debug_Level Service_Object *
ACEVC8:_make_ACE_Logging_Strategy() \" -s r.log -f STDERR|OSTREAM -p
~DEBUG|~INFO|~ERROR -w\"");
if (ACE_Service_Config::process_directive (new_file) != 0) {
        ACE_ERROR ((LM_ERROR,
                ACE_TEXT ("(%P|%t) Service_Config_DLL::svc() - ")
                ACE_TEXT ("process_directive() failed for:\n")
                ACE_TEXT ("\"%s\"\n"),
                new_file));
} else {
        ACE_DEBUG ((LM_INFO,
                ACE_TEXT ("(%P|%t) Service_Config_DLL::svc() - ")
                ACE_TEXT ("process_directive() success for:\n")
                ACE_TEXT ("\"%s\"\n"),
                new_file));
}
...


In fact, i just want to change my program debug level at running
time.I build the source with vc8 and eclipse(mingw).Run the EXE build
with vc8,work fine.But another take a crash.Anybody know why?Or give
me some advice implement the goal.

I konw there is a config file named svc.config,but i need read the
parameter from my config file.

<Prev in Thread] Current Thread [Next in Thread>
  • About ACE_Logging_Strategy, joe <=