diff options
author | Peter Kozak <spag@golwen.net> | 2013-03-13 13:41:33 -0400 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-03-13 13:41:33 -0400 |
commit | ea5289e7c3da5079414d088cb3844032a02ed369 (patch) | |
tree | 896d842de4eaf036c5da3175778888f020f95c27 /misc/freeswitch/scripts/common | |
parent | 7b178c1fa23fd3482f8e74a457cb3bc4a689838a (diff) |
log buffer added
Diffstat (limited to 'misc/freeswitch/scripts/common')
-rw-r--r-- | misc/freeswitch/scripts/common/log.lua | 7 |
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, ...) |