summaryrefslogtreecommitdiff
path: root/examples/Log_Msg/test_log_msg.cpp
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-06-10 06:57:13 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-06-10 06:57:13 +0000
commit40d19f0b25b54205d1e7aebe6f46acdcae9aa074 (patch)
tree4b940f9e6433fb4624eedaa4cc6da541b7356da4 /examples/Log_Msg/test_log_msg.cpp
parentd60818dd178e4fb76fe5f4455352f7ee05950859 (diff)
downloadATCD-40d19f0b25b54205d1e7aebe6f46acdcae9aa074.tar.gz
*** empty log message ***
Diffstat (limited to 'examples/Log_Msg/test_log_msg.cpp')
-rw-r--r--examples/Log_Msg/test_log_msg.cpp41
1 files changed, 30 insertions, 11 deletions
diff --git a/examples/Log_Msg/test_log_msg.cpp b/examples/Log_Msg/test_log_msg.cpp
index 6216aa38c36..7beef0e345d 100644
--- a/examples/Log_Msg/test_log_msg.cpp
+++ b/examples/Log_Msg/test_log_msg.cpp
@@ -1,6 +1,23 @@
-// Test the Log_Msg abstraction.
// $Id$
+// ============================================================================
+//
+// = LIBRARY
+// examples/Log_Msg
+//
+// = FILENAME
+// test_log_msg.cpp
+//
+// = DESCRIPTION
+// This program tests the Log_Msg abstraction and demontrates
+// several use cases.
+//
+// = AUTHOR
+// Douglas Schmidt
+//
+// ============================================================================
+
+
#include "ace/OS.h"
static void
@@ -21,6 +38,8 @@ main (int argc, char *argv[])
{
// Note that the default behavior is to log to STDERR...
+ int counter = 1 ;
+
if (argc > 1)
{
if (ACE_LOG_MSG->open (argv[0], ACE_Log_Msg::OSTREAM) == -1)
@@ -50,32 +69,32 @@ main (int argc, char *argv[])
// Exercise many different combinations of STDERR and OSTREAM.
- ACE_DEBUG ((LM_INFO, "%f, %*s%s = %d\n",
- 3.1416, 8, "", "hello", 10000));
+ ACE_DEBUG ((LM_INFO, "%10f, %*s%s = %d\n",
+ 3.1416 * counter++, 8, "", "hello", 10000));
ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
ACE_LOG_MSG->msg_ostream (&cout);
- ACE_DEBUG ((LM_INFO, "%f, %*s%s = %d\n",
- 3.1416 * 3.1416, 8, "", "world", 20000));
+ ACE_DEBUG ((LM_INFO, "%10f, %*s%s = %d\n",
+ 3.1416 * counter, 8, "", "world", 10000 * counter++));
ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR);
- ACE_DEBUG ((LM_INFO, "%f, %*s%s = %d\n",
- 3.1416 * 3.1416, 8, "", "world", 20000));
+ ACE_DEBUG ((LM_INFO, "%10f, %*s%s = %d\n",
+ 3.1416 * counter, 8, "", "world", 10000 * counter++));
ACE_LOG_MSG->msg_ostream (0);
ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR);
- ACE_DEBUG ((LM_INFO, "%f, %*s%s = %d\n",
- 3.1416 * 3.1416, 8, "", "world", 20000));
+ ACE_DEBUG ((LM_INFO, "%10f, %*s%s = %d\n",
+ 3.1416 * counter, 8, "", "world", 10000 * counter++));
ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM);
ACE_LOG_MSG->msg_ostream (&cerr);
- ACE_DEBUG ((LM_INFO, "%f, %*s%s = %d\n",
- 3.1416 * 3.1416, 8, "", "world", 20000));
+ ACE_DEBUG ((LM_INFO, "%10f, %*s%s = %d\n",
+ 3.1416 * counter, 8, "", "world", 10000 * counter++));
static int array[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048};