diff options
author | Steve Huston <shuston@riverace.com> | 2002-01-23 15:04:05 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2002-01-23 15:04:05 +0000 |
commit | fee7c847f0a68b4516938cdf149c9c86f8f27d45 (patch) | |
tree | 5bfd0ce4d52a35a607c0f0f679b469b7db6418ea /examples | |
parent | 5577250b5c7665a3c921ad785849189630b04f86 (diff) | |
download | ATCD-fee7c847f0a68b4516938cdf149c9c86f8f27d45.tar.gz |
ChangeLogTag:Tue Jan 22 17:42:39 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/NT_Service/main.cpp | 14 | ||||
-rw-r--r-- | examples/NT_Service/ntsvc.cpp | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/examples/NT_Service/main.cpp b/examples/NT_Service/main.cpp index 5f23fa3fb7d..5f8454e2c28 100644 --- a/examples/NT_Service/main.cpp +++ b/examples/NT_Service/main.cpp @@ -188,13 +188,23 @@ Process::run (int argc, ACE_TCHAR* argv[]) } else { + ofstream *output_file = new ofstream("ntsvc.log", ios::out); + if (output_file && output_file->rdstate() == ios::goodbit) + ACE_LOG_MSG->msg_ostream(output_file, 1); + ACE_LOG_MSG->open(argv[0], + ACE_Log_Msg::STDERR | ACE_Log_Msg::OSTREAM, + 0); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): Starting service.\n"))); + ACE_NT_SERVICE_RUN (Beeper, SERVICE::instance (), ret); if (ret == 0) ACE_ERROR ((LM_ERROR, - "%p\n", - "Couldn't start service")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("Couldn't start service"))); + else + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): Service stopped.\n"))); } return 0; diff --git a/examples/NT_Service/ntsvc.cpp b/examples/NT_Service/ntsvc.cpp index c671f4a7967..d872769bc46 100644 --- a/examples/NT_Service/ntsvc.cpp +++ b/examples/NT_Service/ntsvc.cpp @@ -72,6 +72,7 @@ Service::handle_timeout (const ACE_Time_Value &tv, { ACE_UNUSED_ARG (tv); MessageBeep (MB_OK); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): Beep...\n"))); return 0; } |