summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts/common
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-17 12:45:23 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-17 12:45:23 +0100
commitd007b83d1d6b51caea93b5f08f449db88a930a16 (patch)
tree53c3ff07977cd374182358acef4b821a17e345b6 /misc/freeswitch/scripts/common
parent0ed2894ca7371199788c202b61f53a3f73c4b03b (diff)
parentabc16da2c2afa636a928a031a540e677f4ac84f8 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'misc/freeswitch/scripts/common')
-rw-r--r--misc/freeswitch/scripts/common/log.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/misc/freeswitch/scripts/common/log.lua b/misc/freeswitch/scripts/common/log.lua
index f224070..b9893ac 100644
--- a/misc/freeswitch/scripts/common/log.lua
+++ b/misc/freeswitch/scripts/common/log.lua
@@ -24,6 +24,7 @@ function Log.new(self, arg)
self.level_notice = arg.level_notice or 5;
self.level_info = arg.level_info or 6;
self.level_debug = arg.level_debug or 7;
+ self.level_devel = arg.level_devel or 4;
return object;
end
@@ -35,7 +36,12 @@ function Log.message(self, log_level, message_arguments )
local message = tostring(self.prefix);
for index, value in pairs(message_arguments) do
if type(index) == 'number' then
- message = message .. tostring(value);
+ if type(value) == 'table' then
+ require 'common.array';
+ message = message .. common.array.to_json(value);
+ else
+ message = message .. tostring(value);
+ end
end
end
if self.buffer then
@@ -76,3 +82,9 @@ end
function Log.debug(self, ...)
self:message(self.level_debug, {...});
end
+
+function Log.devel(self, ...)
+ local arguments = {...};
+ table.insert(arguments, 1, '**');
+ self:message(self.level_devel, arguments);
+end