aboutsummaryrefslogtreecommitdiffstats
path: root/core/loggingmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-17 13:50:33 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-17 13:50:33 +0000
commit8ee0fb71fcba10a54760d4a047a4a91e2ab97ad1 (patch)
tree08ff2f81be281c7d1f399e2e3ff5b74f1671b77b /core/loggingmanager.lua
parentc1efda1ffd82e6988ab20b4be5f75ecf31fb551e (diff)
parent07e945631dc2abe7a2afe204919a72d25398c687 (diff)
downloadprosody-8ee0fb71fcba10a54760d4a047a4a91e2ab97ad1.tar.gz
prosody-8ee0fb71fcba10a54760d4a047a4a91e2ab97ad1.zip
Merge Tobias->trunk
Diffstat (limited to 'core/loggingmanager.lua')
-rw-r--r--core/loggingmanager.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua
index 3cd09431..40b96d52 100644
--- a/core/loggingmanager.lua
+++ b/core/loggingmanager.lua
@@ -15,7 +15,7 @@ local tostring, setmetatable, rawset, pairs, ipairs, type =
local io_open, io_write = io.open, io.write;
local math_max, rep = math.max, string.rep;
local os_date, os_getenv = os.date, os.getenv;
-local getstyle, getstring = require "util.termcolours".getstyle, require "util.termcolours".getstring;
+local getstyle, setstyle = require "util.termcolours".getstyle, require "util.termcolours".setstyle;
if os.getenv("__FLUSH_LOG") then
local io_flush = io.flush;
@@ -217,7 +217,7 @@ function log_sink_types.stdout()
end
do
- local do_pretty_printing = not os_getenv("WINDIR");
+ local do_pretty_printing = true;
local logstyles = {};
if do_pretty_printing then
@@ -244,10 +244,14 @@ do
if timestamps then
io_write(os_date(timestamps), " ");
end
+ io_write(name, rep(" ", sourcewidth-namelen));
+ setstyle(logstyles[level]);
+ io_write(level);
+ setstyle();
if ... then
- io_write(name, rep(" ", sourcewidth-namelen), getstring(logstyles[level], level), "\t", format(message, ...), "\n");
+ io_write("\t", format(message, ...), "\n");
else
- io_write(name, rep(" ", sourcewidth-namelen), getstring(logstyles[level], level), "\t", message, "\n");
+ io_write("\t", message, "\n");
end
end
end