Added avp.log function

squeeze-backports
Victor Seva 12 years ago
parent fbfd97c680
commit 6e76b4c466

@ -27,6 +27,14 @@ NGCPAvp_MT = {
return setmetatable( t, NGCPAvp_MT ) return setmetatable( t, NGCPAvp_MT )
end end
function NGCPAvp:log(level)
local value = sr.pv.get(self.id)
if not level then
level = "dbg"
end
sr.log(level, string.format("%s:%s\n", self.id, tostring(value)))
end
function NGCPAvp:clean() function NGCPAvp:clean()
--print("NGCPAvp:clean") --print("NGCPAvp:clean")
--print(table.tostring(getmetatable(self))) --print(table.tostring(getmetatable(self)))

@ -53,5 +53,9 @@ TestNGCPAvp = {} --class
self.avp:clean() self.avp:clean()
assertFalse(self.avp()) assertFalse(self.avp())
end end
function TestNGCPAvp:test_log()
self.avp:log()
end
-- class TestNGCPAvp -- class TestNGCPAvp
--EOF --EOF
Loading…
Cancel
Save