summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-13 11:53:44 -0400
committerPeter Kozak <spag@golwen.net>2013-03-13 11:53:44 -0400
commita36e9a798e1e002a5152319dbdcd144d45a6e4ad (patch)
tree25cdea1bdc31102d1f0bcfd1c7bd5e0721f67ba2
parent98bfa93ef9a9383a6c0585a081178bb45f6a4097 (diff)
disable_log option added
-rw-r--r--misc/freeswitch/scripts/common/log.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/freeswitch/scripts/common/log.lua b/misc/freeswitch/scripts/common/log.lua
index b7c8d09..e6aa7fa 100644
--- a/misc/freeswitch/scripts/common/log.lua
+++ b/misc/freeswitch/scripts/common/log.lua
@@ -12,6 +12,7 @@ function Log.new(self, arg)
object = arg.object or {}
setmetatable(object, self);
self.__index = self;
+ self.disabled = arg.disabled or false;
self.prefix = arg.prefix or '### ';
self.level_console = arg.level_console or 0;
@@ -27,6 +28,9 @@ function Log.new(self, arg)
end
function Log.message(self, log_level, message_arguments )
+ if self.disabled then
+ return
+ end
local message = tostring(self.prefix);
for index, value in pairs(message_arguments) do
if type(index) == 'number' then