From 5bdf71a3c5b4c1a342c5c6bc644e8feea62d17b8 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 6 Mar 2016 07:53:32 +0000 Subject: Logging; only show the time... ... we know what day it is! --- background_scripts/bg_utils.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'background_scripts/bg_utils.coffee') diff --git a/background_scripts/bg_utils.coffee b/background_scripts/bg_utils.coffee index bff005ab..ca823247 100644 --- a/background_scripts/bg_utils.coffee +++ b/background_scripts/bg_utils.coffee @@ -65,6 +65,14 @@ BgUtils = # Don't log messages from the logging page itself. We do this check late because most of the time # it's not needed. if sender?.url != loggingPageUrl - viewWindow.document.getElementById("log-text").value += "#{(new Date()).toISOString()}: #{message}\n" + date = new Date + [hours, minutes, seconds, milliseconds] = + [date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()] + minutes = "0" + minutes if minutes < 10 + seconds = "0" + seconds if seconds < 10 + milliseconds = "00" + milliseconds if milliseconds < 10 + milliseconds = "0" + milliseconds if milliseconds < 100 + dateString = "#{hours}:#{minutes}:#{seconds}.#{milliseconds}" + viewWindow.document.getElementById("log-text").value += "#{dateString}: #{message}\n" root.BgUtils = BgUtils -- cgit v1.2.3