*** empty log message ***

This commit is contained in:
David Rose 2001-04-25 15:02:20 +00:00
parent e25da87b45
commit 7389f48672
4 changed files with 22 additions and 0 deletions

View File

@ -22,3 +22,13 @@ get_assert_abort() {
}
return *assert_abort;
}
bool
get_notify_timestamp() {
static bool *notify_timestamp = (bool *)NULL;
if (notify_timestamp == (bool *)NULL) {
notify_timestamp = new bool;
*notify_timestamp = config_notify.GetBool("notify-timestamp", false);
}
return *notify_timestamp;
}

View File

@ -12,5 +12,6 @@
ConfigureDecl(config_notify, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG);
bool get_assert_abort();
bool get_notify_timestamp();
#endif /* __CONFIG_NOTIFY_H__ */

View File

@ -10,6 +10,7 @@
#include <filename.h>
#include <ctype.h>
#include <time.h> // for strftime().
Notify *Notify::_global_ptr = (Notify *)NULL;

View File

@ -85,6 +85,16 @@ ostream &NotifyCategory::
out(NotifySeverity severity, bool prefix) const {
if (is_on(severity)) {
if (prefix) {
if (get_notify_timestamp()) {
// Format a timestamp to include as a prefix as well.
time_t now = time(NULL);
struct tm *ptm = localtime(&now);
char buffer[128];
strftime(buffer, 128, ":%m-%d-%Y %H:%M:%S ", ptm);
nout << buffer;
}
if (severity == NS_info) {
return nout << *this << ": ";
} else {