*** empty log message ***
This commit is contained in:
parent
e25da87b45
commit
7389f48672
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,6 @@
|
|||
ConfigureDecl(config_notify, EXPCL_DTOOLCONFIG, EXPTP_DTOOLCONFIG);
|
||||
|
||||
bool get_assert_abort();
|
||||
bool get_notify_timestamp();
|
||||
|
||||
#endif /* __CONFIG_NOTIFY_H__ */
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <filename.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <time.h> // for strftime().
|
||||
|
||||
Notify *Notify::_global_ptr = (Notify *)NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue