summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-04 19:05:56 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-04 19:05:56 +0000
commitd73e4c6da151d0cff5101d274406fe546cb6cbdd (patch)
treec45b4b625030f963149af1e0e7919617c9b7563b /ace
parent5637809c2337aa8dc73c0a2ade2472e2b286e4c1 (diff)
downloadATCD-d73e4c6da151d0cff5101d274406fe546cb6cbdd.tar.gz
Added a new format character A
Diffstat (limited to 'ace')
-rw-r--r--ace/Log_Msg.cpp13
-rw-r--r--ace/Log_Msg.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 58232a4435f..49bcab05d94 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -564,6 +564,7 @@ ACE_Log_Msg::open (const ASYS_TCHAR *prog_name,
}
// Valid Options (prefixed by '%', as in printf format strings) include:
+// 'A': print an ACE_timer_t value
// 'a': exit the program at this point (var-argument is the exit status!)
// 'c': print a character
// 'i', 'd': print a decimal number
@@ -687,6 +688,18 @@ ACE_Log_Msg::log (const ASYS_TCHAR *format_str,
{
switch (*format++)
{
+ case 'A':
+ type = SKIP_SPRINTF;
+ {
+#if defined (ACE_LACKS_FLOATING_POINT)
+ ACE_UINT32 value = va_arg (argp, ACE_UINT32);
+ ACE_OS::sprintf (bp, ASYS_TEXT ("%ld"), value);
+#else
+ double value = va_arg (argp, double);
+ ACE_OS::sprintf (bp, ASYS_TEXT ("%f"), value);
+#endif /* ACE_LACKS_FLOATING_POINT */
+ }
+ break;
case 'a': // Abort program after handling all of format string.
type = SKIP_SPRINTF;
abort_prog = 1;
diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h
index ae1214ef274..a41f324a3b7 100644
--- a/ace/Log_Msg.h
+++ b/ace/Log_Msg.h
@@ -308,6 +308,7 @@ public:
ssize_t log (ACE_Log_Priority priority, const ASYS_TCHAR *format, ...);
// Format a message to the thread-safe ACE logging mechanism. Valid
// options (prefixed by '%', as in printf format strings) include:
+// 'A': print an ACE_timer_t value (which could be either double or ACE_UINT32.)
// 'a': exit the program at this point (var-argument is the exit status!)
// 'c': print a character
// 'i', 'd': print a decimal number