summaryrefslogtreecommitdiff
path: root/misc/freeswitch
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-13 13:41:33 -0400
committerPeter Kozak <spag@golwen.net>2013-03-13 13:41:33 -0400
commitea5289e7c3da5079414d088cb3844032a02ed369 (patch)
tree896d842de4eaf036c5da3175778888f020f95c27 /misc/freeswitch
parent7b178c1fa23fd3482f8e74a457cb3bc4a689838a (diff)
log buffer added
Diffstat (limited to 'misc/freeswitch')
-rw-r--r--misc/freeswitch/scripts/common/log.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/misc/freeswitch/scripts/common/log.lua b/misc/freeswitch/scripts/common/log.lua
index e6aa7fa..f224070 100644
--- a/misc/freeswitch/scripts/common/log.lua
+++ b/misc/freeswitch/scripts/common/log.lua
@@ -13,6 +13,7 @@ function Log.new(self, arg)
setmetatable(object, self);
self.__index = self;
self.disabled = arg.disabled or false;
+ self.buffer = arg.buffer;
self.prefix = arg.prefix or '### ';
self.level_console = arg.level_console or 0;
@@ -37,7 +38,11 @@ function Log.message(self, log_level, message_arguments )
message = message .. tostring(value);
end
end
- freeswitch.consoleLog(log_level, message .. '\n');
+ if self.buffer then
+ table.insert(self.buffer, message);
+ elseif freeswitch then
+ freeswitch.consoleLog(log_level, message .. '\n');
+ end
end
function Log.console(self, ...)