summaryrefslogtreecommitdiff
path: root/misc/freeswitch/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'misc/freeswitch/scripts')
-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