summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2001-12-02 00:44:49 +0000
committerSteve Huston <shuston@riverace.com>2001-12-02 00:44:49 +0000
commit219035b034cc031789529769deedf1c18dcfd042 (patch)
tree44e4d3305c697e92f8933bd708ce9a8f068fc550
parent3265837a8308d3915e410c8b73b14826951cd101 (diff)
downloadATCD-219035b034cc031789529769deedf1c18dcfd042.tar.gz
ChangeLogTag:Sat Dec 1 19:39:22 2001 Steve Huston <shuston@riverace.com>
-rw-r--r--ChangeLog28
-rw-r--r--ChangeLogs/ChangeLog-02a28
-rw-r--r--ChangeLogs/ChangeLog-03a28
-rw-r--r--THANKS1
-rw-r--r--ace/Date_Time.i5
-rw-r--r--ace/Log_Msg.cpp4
-rw-r--r--ace/Log_Msg_NT_Event_Log.cpp3
-rw-r--r--ace/Log_Msg_NT_Event_Log.h7
-rw-r--r--ace/Log_Msg_UNIX_Syslog.cpp5
-rw-r--r--ace/Log_Msg_UNIX_Syslog.h7
10 files changed, 100 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index e644a2f590f..d5a9b9c5b8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+Sat Dec 1 19:39:22 2001 Steve Huston <shuston@riverace.com>
+
+ * ace/Date_Time.i (update): Use ACE_OS::gettimeofday for the time
+ source. This gets both the seconds-since-epoch value from which
+ the date and time are calculated and the microseconds value.
+ Thanks to Jim Connelly <jim.connelly@neustar.com> for reporting this.
+
+ * THANKS: Added Jim Connelly to the Hall of Fame.
+
+ * ace/Log_Msg_NT_Event_Log.{cpp h} (open):
+ * ace/Log_Msg_UNIX_Syslog.{cpp h} (open):
+ If the caller passes a prog_name (logger_key) argument, use it
+ for the Source field in the event log entries (or ident in the
+ syslog entries). If not, use the program name (previous behavior).
+ Added comments to define this behavior.
+
+ * ace/Log_Msg.cpp (open): Don't refuse to open a backend if the
+ <logger_key> arg is 0 and the SYSLOG bit is enabled. The SYSLOG
+ backends, both UNIX and NT Event Log, work perfectly fine with
+ a 0 logger_key. Thanks to Steve Witten <steve_witten@hp.com> for
+ reporting this.
+
Sat Dec 1 18:03:51 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/config-macosx.h:
@@ -571,9 +593,9 @@ Thu Nov 8 10:41:44 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
the differences between ACE_OS::strsncpy() and ACE_OS::strcpy()
more precisely. Thanks to Alain Decamps for contributing this.
- * ace/Naming_Context.{h,cpp}: The info() method should have ACE_TCHAR **
- rather than char **. Thanks to Johnny Willemsen for reporting
- this.
+ * ace/Naming_Context.{h,cpp}: The info() method should have
+ ACE_TCHAR ** rather than char **. Thanks to Johnny Willemsen
+ for reporting this.
* ace/OS.cpp: Added support for Borland's idiosyncratic _wfdopen()
method. Thanks to Johnny Willemsen for reporting this.
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index e644a2f590f..d5a9b9c5b8c 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,25 @@
+Sat Dec 1 19:39:22 2001 Steve Huston <shuston@riverace.com>
+
+ * ace/Date_Time.i (update): Use ACE_OS::gettimeofday for the time
+ source. This gets both the seconds-since-epoch value from which
+ the date and time are calculated and the microseconds value.
+ Thanks to Jim Connelly <jim.connelly@neustar.com> for reporting this.
+
+ * THANKS: Added Jim Connelly to the Hall of Fame.
+
+ * ace/Log_Msg_NT_Event_Log.{cpp h} (open):
+ * ace/Log_Msg_UNIX_Syslog.{cpp h} (open):
+ If the caller passes a prog_name (logger_key) argument, use it
+ for the Source field in the event log entries (or ident in the
+ syslog entries). If not, use the program name (previous behavior).
+ Added comments to define this behavior.
+
+ * ace/Log_Msg.cpp (open): Don't refuse to open a backend if the
+ <logger_key> arg is 0 and the SYSLOG bit is enabled. The SYSLOG
+ backends, both UNIX and NT Event Log, work perfectly fine with
+ a 0 logger_key. Thanks to Steve Witten <steve_witten@hp.com> for
+ reporting this.
+
Sat Dec 1 18:03:51 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/config-macosx.h:
@@ -571,9 +593,9 @@ Thu Nov 8 10:41:44 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
the differences between ACE_OS::strsncpy() and ACE_OS::strcpy()
more precisely. Thanks to Alain Decamps for contributing this.
- * ace/Naming_Context.{h,cpp}: The info() method should have ACE_TCHAR **
- rather than char **. Thanks to Johnny Willemsen for reporting
- this.
+ * ace/Naming_Context.{h,cpp}: The info() method should have
+ ACE_TCHAR ** rather than char **. Thanks to Johnny Willemsen
+ for reporting this.
* ace/OS.cpp: Added support for Borland's idiosyncratic _wfdopen()
method. Thanks to Johnny Willemsen for reporting this.
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index e644a2f590f..d5a9b9c5b8c 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,25 @@
+Sat Dec 1 19:39:22 2001 Steve Huston <shuston@riverace.com>
+
+ * ace/Date_Time.i (update): Use ACE_OS::gettimeofday for the time
+ source. This gets both the seconds-since-epoch value from which
+ the date and time are calculated and the microseconds value.
+ Thanks to Jim Connelly <jim.connelly@neustar.com> for reporting this.
+
+ * THANKS: Added Jim Connelly to the Hall of Fame.
+
+ * ace/Log_Msg_NT_Event_Log.{cpp h} (open):
+ * ace/Log_Msg_UNIX_Syslog.{cpp h} (open):
+ If the caller passes a prog_name (logger_key) argument, use it
+ for the Source field in the event log entries (or ident in the
+ syslog entries). If not, use the program name (previous behavior).
+ Added comments to define this behavior.
+
+ * ace/Log_Msg.cpp (open): Don't refuse to open a backend if the
+ <logger_key> arg is 0 and the SYSLOG bit is enabled. The SYSLOG
+ backends, both UNIX and NT Event Log, work perfectly fine with
+ a 0 logger_key. Thanks to Steve Witten <steve_witten@hp.com> for
+ reporting this.
+
Sat Dec 1 18:03:51 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/config-macosx.h:
@@ -571,9 +593,9 @@ Thu Nov 8 10:41:44 2001 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu>
the differences between ACE_OS::strsncpy() and ACE_OS::strcpy()
more precisely. Thanks to Alain Decamps for contributing this.
- * ace/Naming_Context.{h,cpp}: The info() method should have ACE_TCHAR **
- rather than char **. Thanks to Johnny Willemsen for reporting
- this.
+ * ace/Naming_Context.{h,cpp}: The info() method should have
+ ACE_TCHAR ** rather than char **. Thanks to Johnny Willemsen
+ for reporting this.
* ace/OS.cpp: Added support for Borland's idiosyncratic _wfdopen()
method. Thanks to Johnny Willemsen for reporting this.
diff --git a/THANKS b/THANKS
index 6c7a472a47d..497b0da1fc4 100644
--- a/THANKS
+++ b/THANKS
@@ -1368,6 +1368,7 @@ Bo Balder <bba@post.utfors.se>
Michael Sawczyn <msawczyn@columbus.rr.com>
Ildar Gabdulline <ildar_gabdullin@mailru.com>
David Yongqiang Wang <davidyw@avaya.com>
+Jim Connelly <jim.connelly@neustar.com>
Andrew Foster <awf@prismtechnologies.com>
C Chan <CChan@md.aacisd.com>
Alexey Chalimov <alexey@allcharge.com>
diff --git a/ace/Date_Time.i b/ace/Date_Time.i
index 27c7c4f26da..9913f129327 100644
--- a/ace/Date_Time.i
+++ b/ace/Date_Time.i
@@ -8,8 +8,8 @@ ACE_Date_Time::update (void)
{
ACE_TRACE ("ACE_Date_Time::update");
- time_t time;
- ACE_OS::time (&time);
+ ACE_Time_Value now = ACE_OS::gettimeofday ();
+ time_t time = now.sec ();
struct tm *tm_time = ACE_OS::localtime (&time);
this->day_ = tm_time->tm_mday;
this->month_ = tm_time->tm_mon + 1; // localtime's months are 0-11
@@ -17,6 +17,7 @@ ACE_Date_Time::update (void)
this->hour_ = tm_time->tm_hour;
this->minute_ = tm_time->tm_min;
this->second_ = tm_time->tm_sec;
+ this->microsec_ = now.usec ();
}
ASYS_INLINE
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 56ed32d7b7e..f2305b1b265 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -717,7 +717,9 @@ ACE_Log_Msg::open (const ACE_TCHAR *prog_name,
if (ACE_BIT_ENABLED (flags, ACE_Log_Msg::LOGGER)
|| ACE_BIT_ENABLED (flags, ACE_Log_Msg::SYSLOG))
{
- if (logger_key == 0)
+ // The SYSLOG backends (both NT and UNIX) can get along fine
+ // without the logger_key.
+ if (logger_key == 0 && ACE_BIT_ENABLED (flags, ACE_Log_Msg::LOGGER))
status = -1;
else
{
diff --git a/ace/Log_Msg_NT_Event_Log.cpp b/ace/Log_Msg_NT_Event_Log.cpp
index 71502ec2092..60bc8eed684 100644
--- a/ace/Log_Msg_NT_Event_Log.cpp
+++ b/ace/Log_Msg_NT_Event_Log.cpp
@@ -23,7 +23,6 @@ ACE_Log_Msg_NT_Event_Log::~ACE_Log_Msg_NT_Event_Log (void)
int
ACE_Log_Msg_NT_Event_Log::open (const ACE_TCHAR *logger_key)
{
- ACE_UNUSED_ARG (logger_key);
// ACE's "resource module" contains the message resource required
// for event logging.
ACE_TCHAR msg_file [MAXPATHLEN];
@@ -41,7 +40,7 @@ ACE_Log_Msg_NT_Event_Log::open (const ACE_TCHAR *logger_key)
ACE_LIB_TEXT ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\"));
int reg_key_length = ACE_OS::strlen(reg_key);
ACE_OS::strncat (reg_key,
- ACE_Log_Msg::program_name (),
+ logger_key ? logger_key : ACE_Log_Msg::program_name (),
MAXPATHLEN - reg_key_length);
// Add the event source to the registry. Note that if this fails it
diff --git a/ace/Log_Msg_NT_Event_Log.h b/ace/Log_Msg_NT_Event_Log.h
index 75bbb4839d7..4e2b8cf6697 100644
--- a/ace/Log_Msg_NT_Event_Log.h
+++ b/ace/Log_Msg_NT_Event_Log.h
@@ -40,6 +40,13 @@ public:
virtual ~ACE_Log_Msg_NT_Event_Log (void);
/// Open a new event log.
+ /**
+ * Initialize the event logging facility.
+ * @param logger_key The name of the calling program. This name is
+ * used in the Source field of the event log. If
+ * it is 0 (no name), the application name as
+ * returned from ACE_Log_Msg::program_name() is used.
+ */
virtual int open (const ACE_TCHAR *logger_key);
/// Reset the backend.
diff --git a/ace/Log_Msg_UNIX_Syslog.cpp b/ace/Log_Msg_UNIX_Syslog.cpp
index d44de31bfd6..3389849240b 100644
--- a/ace/Log_Msg_UNIX_Syslog.cpp
+++ b/ace/Log_Msg_UNIX_Syslog.cpp
@@ -32,13 +32,14 @@ ACE_Log_Msg_UNIX_Syslog::~ACE_Log_Msg_UNIX_Syslog (void)
int
ACE_Log_Msg_UNIX_Syslog::open (const ACE_TCHAR * logger_key)
{
- ACE_UNUSED_ARG (logger_key);
+ if (logger_key == 0)
+ logger_key = ACE_Log_Msg::program_name ();
// Initialize the UNIX syslog facility. Default the syslog log
// options LOG_CONS and LOG_PID to be set. There really should be a
// logging strategy option to control the syslog log options,
// however, we'll take the easy way out for now.
- openlog (ACE_const_cast (char *, ACE_Log_Msg::program_name ()),
+ openlog (ACE_const_cast (char *, logger_key),
LOG_CONS|LOG_PID,
ACE_DEFAULT_SYSLOG_FACILITY);
diff --git a/ace/Log_Msg_UNIX_Syslog.h b/ace/Log_Msg_UNIX_Syslog.h
index b397487cf2e..4c63d9de80e 100644
--- a/ace/Log_Msg_UNIX_Syslog.h
+++ b/ace/Log_Msg_UNIX_Syslog.h
@@ -40,6 +40,13 @@ public:
virtual ~ACE_Log_Msg_UNIX_Syslog (void);
/// Open a new event log.
+ /**
+ * Initialize the event logging facility.
+ * @param logger_key The name of the calling program. This name is
+ * used as the @arg ident in the syslog entries. If
+ * it is 0 (no name), the application name as
+ * returned from ACE_Log_Msg::program_name() is used.
+ */
virtual int open (const ACE_TCHAR *logger_key);
/// Reset the backend.