summaryrefslogtreecommitdiff
path: root/ace/Log_Record.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Log_Record.cpp')
-rw-r--r--ace/Log_Record.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/ace/Log_Record.cpp b/ace/Log_Record.cpp
index 326628ae6a1..d5ca1493b4a 100644
--- a/ace/Log_Record.cpp
+++ b/ace/Log_Record.cpp
@@ -174,18 +174,6 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
/* Oct 18 14:25:36.000 1989<nul> */
ACE_TCHAR timestamp[26]; // Only used by VERBOSE and VERBOSE_LITE.
- // The sprintf format needs to be different for Windows and POSIX
- // in the wide-char case.
-#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
- const ACE_TCHAR *time_fmt = ACE_LIB_TEXT ("%s.%03ld %s");
- const ACE_TCHAR *verbose_fmt = ACE_LIB_TEXT ("%s@%s@%u@%s@%s");
- const ACE_TCHAR *verbose_lite_fmt = ACE_LIB_TEXT ("%s@%s@%s");
-#else
- const ACE_TCHAR *time_fmt = ACE_LIB_TEXT ("%ls.%03ld %ls");
- const ACE_TCHAR *verbose_fmt = ACE_LIB_TEXT ("%ls@%ls@%u@%ls@%ls");
- const ACE_TCHAR *verbose_lite_fmt = ACE_LIB_TEXT ("%ls@%ls@%ls");
-#endif
-
if (ACE_BIT_ENABLED (verbose_flag,
ACE_Log_Msg::VERBOSE)
|| ACE_BIT_ENABLED (verbose_flag,
@@ -204,7 +192,7 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
ctp[24] = '\0'; // NUL-terminate after the date.
ACE_OS::sprintf (timestamp,
- time_fmt,
+ ACE_LIB_TEXT ("%s.%03ld %s"),
ctp + 4,
((long) this->usecs_) / 1000,
ctp + 20);
@@ -223,7 +211,7 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
: host_name);
# endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */
ACE_OS::sprintf (verbose_msg,
- verbose_fmt,
+ ACE_LIB_TEXT ("%s@%s@%u@%s@%s"),
timestamp,
lhost_name,
this->pid_,
@@ -232,12 +220,14 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[],
}
else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE))
ACE_OS::sprintf (verbose_msg,
- verbose_lite_fmt,
+ ACE_LIB_TEXT ("%s@%s@%s"),
timestamp,
ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)),
this->msg_data_);
else
- ACE_OS::strcpy (verbose_msg, this->msg_data_);
+ ACE_OS::sprintf (verbose_msg,
+ ACE_LIB_TEXT ("%s"),
+ this->msg_data_);
return 0;
}