aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/bg_utils.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-03-06 07:53:32 +0000
committerStephen Blott2016-03-17 14:26:43 +0000
commit5bdf71a3c5b4c1a342c5c6bc644e8feea62d17b8 (patch)
tree133954aa2a5293b37552323a2e4f69fe3937bec9 /background_scripts/bg_utils.coffee
parenta7cd51c8b4c6694ec66711535dbba4ba7a3b813b (diff)
downloadvimium-5bdf71a3c5b4c1a342c5c6bc644e8feea62d17b8.tar.bz2
Logging; only show the time...
... we know what day it is!
Diffstat (limited to 'background_scripts/bg_utils.coffee')
-rw-r--r--background_scripts/bg_utils.coffee10
1 files changed, 9 insertions, 1 deletions
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