Logging
This commit is contained in:
parent
787e363bdf
commit
3352844024
7
init.lua
7
init.lua
@ -32,7 +32,7 @@ local token = core.settings:get("yl_matterbridge.token") or ""
|
|||||||
|
|
||||||
local http = core.request_http_api()
|
local http = core.request_http_api()
|
||||||
|
|
||||||
assert(http, "Please add yl_matterbridge to secure.http_mods")
|
assert(http, "[MOD] yl_matterbridge: Please add yl_matterbridge to secure.http_mods")
|
||||||
|
|
||||||
function send(user_name, message_text)
|
function send(user_name, message_text)
|
||||||
local url = "http://" .. address .. ":" .. port .. "/api/message"
|
local url = "http://" .. address .. ":" .. port .. "/api/message"
|
||||||
@ -54,9 +54,8 @@ function send(user_name, message_text)
|
|||||||
function(result)
|
function(result)
|
||||||
if result.succeeded then
|
if result.succeeded then
|
||||||
local data = core.parse_json(result.data)
|
local data = core.parse_json(result.data)
|
||||||
core.log("action", "[MOD] yl_matterbridge : Posted " .. dump(data))
|
|
||||||
else
|
else
|
||||||
core.log("error", "[yl_matterbridge] " .. dump(result))
|
core.log("error", "[MOD] yl_matterbridge: send/http.fetch failed. Result = " .. dump(result))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -82,7 +81,7 @@ local function receive()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
core.log("error", "[yl_matterbridge] " .. dump(result))
|
core.log("error", "[MOD] yl_matterbridge: receive/http.fetch failed. Result = " .. dump(result))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user