Changeset

1501:4b55110b0aa8

mod_message_logging: Add timestamp to logs
author Matthew Wild <mwild1@gmail.com>
date Sun, 07 Sep 2014 12:19:25 +0100
parents 1500:045720a5fccd
children 1502:72ef98818b90
files mod_message_logging/mod_message_logging.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_message_logging/mod_message_logging.lua	Sun Sep 07 08:08:09 2014 +0100
+++ b/mod_message_logging/mod_message_logging.lua	Sun Sep 07 12:19:25 2014 +0100
@@ -55,7 +55,7 @@
 	local f = open_files[log_jid];
 	if not f then return; end
 	body = body:gsub("\n", "\n    "); -- Indent newlines
-	f:write(prefix or "", prefix and ": " or "", jid, ": ", body, "\n");
+	f:write(os.date("%H:%M:%S "), prefix or "", prefix and ": " or "", jid, ": ", body, "\n");
 	f:flush();
 end