summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/gtk_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gtkmm2ext/gtk_ui.cc')
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc
index 34a6d1f53e..d1e834d892 100644
--- a/libs/gtkmm2ext/gtk_ui.cc
+++ b/libs/gtkmm2ext/gtk_ui.cc
@@ -36,6 +36,7 @@
#include "pbd/error.h"
#include "pbd/touchable.h"
#include "pbd/failed_constructor.h"
+#include "pbd/localtime_r.h"
#include "pbd/pthread_utils.h"
#include "pbd/replace_all.h"
@@ -643,6 +644,13 @@ UI::display_message (const char *prefix, gint /*prefix_len*/, RefPtr<TextBuffer:
{
RefPtr<TextBuffer> buffer (errors->text().get_buffer());
+ char timebuf[128];
+ time_t n = time (NULL);
+ struct tm local_time;
+ localtime_r (&n, &local_time);
+ strftime (timebuf, sizeof(timebuf), "%FT%H.%M.%S ", &local_time);
+
+ buffer->insert_with_tag(buffer->end(), timebuf, ptag);
buffer->insert_with_tag(buffer->end(), prefix, ptag);
buffer->insert_with_tag(buffer->end(), msg, mtag);
buffer->insert_with_tag(buffer->end(), "\n", mtag);