main.InternetDetector.debugOutput().

This commit is contained in:
gSpot
2025-06-24 18:24:15 +03:00
parent ef40cb3051
commit f9aa55ca4d
15 changed files with 77 additions and 86 deletions

View File

@@ -5,8 +5,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=internet-detector-mod-email
PKG_VERSION:=1.5.1
PKG_RELEASE:=2
PKG_VERSION:=1.5.2
PKG_RELEASE:=1
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/luci-app-internet-detector>
include $(INCLUDE_DIR)/package.mk

View File

@@ -11,6 +11,7 @@ local Module = {
debug = false,
},
syslog = function(level, msg) return true end,
debugOutput = function(msg) return true end,
writeValue = function(filePath, str) return false end,
readValue = function(filePath) return nil end,
deadPeriod = 0,
@@ -122,8 +123,7 @@ function Module:sendMessage(msg, textPattern)
-- Debug
if self.config.debug then
verboseArg = " -v"
io.stdout:write(string.format("--- %s ---\n", self.name))
io.stdout:flush()
self.debugOutput(string.format("--- %s ---", self.name))
end
local securityArgs = "-starttls -auth-login"
@@ -141,8 +141,7 @@ function Module:sendMessage(msg, textPattern)
-- Debug
if self.config.debug then
io.stdout:write(string.format("%s: %s\n", self.name, mtaCmd))
io.stdout:flush()
self.debugOutput(string.format("%s: %s", self.name, mtaCmd))
self.syslog("debug", string.format("%s: %s", self.name, mtaCmd))
end