summaryrefslogtreecommitdiff
path: root/ace/Log_Record.cpp
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-10 08:07:06 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-10 08:07:06 +0000
commit9b6545cfbc0a3dad498ce6e8ceb45498a933b962 (patch)
treed8f427ee2a0f9a99c56f86ae856efc2bbe89c3ae /ace/Log_Record.cpp
parent31d182db6c7f56340ce7f7e351b1f53bc608ad95 (diff)
downloadATCD-9b6545cfbc0a3dad498ce6e8ceb45498a933b962.tar.gz
Added CE specialization
Diffstat (limited to 'ace/Log_Record.cpp')
-rw-r--r--ace/Log_Record.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/ace/Log_Record.cpp b/ace/Log_Record.cpp
index f2143f46bd9..b9b7e97fc67 100644
--- a/ace/Log_Record.cpp
+++ b/ace/Log_Record.cpp
@@ -176,4 +176,50 @@ ACE_Log_Record::print (const ASYS_TCHAR host_name[],
s.flush ();
return 0;
}
+#else /* ACE_HAS_WINCE */
+int
+ACE_Log_Record::print (const ASYS_TCHAR *host_name,
+ int verbose,
+ ACE_CE_Bridge *log_window)
+{
+ // ACE_TRACE ("ACE_Log_Record::print");
+
+ int ret;
+ CString *msg = new CString ();
+
+ if (verbose)
+ {
+ time_t now = this->time_stamp_.sec ();
+ ASYS_TCHAR ctp[26]; // 26 is a magic number...
+
+ if (ACE_OS::ctime_r (&now, ctp, sizeof ctp) == 0)
+ return -1;
+
+ /* 01234567890123456789012345 */
+ /* Wed Oct 18 14:25:36 1989n0 */
+
+ ctp[19] = '\0'; // NUL-terminate after the time.
+ ctp[24] = '\0'; // NUL-terminate after the date.
+
+ const ASYS_TCHAR *lhost_name = host_name ==
+ 0 ? ASYS_TEXT ("<local_host>") : host_name;
+
+ msg->Format (ASYS_TEXT ("%s.%d %s@%s@%d@%d@%s"),
+ ctp + 4,
+ this->time_stamp_.usec () / 1000,
+ ctp + 20,
+ lhost_name,
+ this->pid_,
+ this->type_,
+ this->msg_data_);
+ }
+ else
+ msg->Format (ASYS_TEXT ("%s"), this->msg_data_);
+
+ if (log_window == 0)
+ log_window = ACE_CE_Bridge::get_default_winbridge ();
+ log_window->write_msg (msg);
+
+ return ret;
+}
#endif /* ! ACE_HAS_WINCE */