sdk: add a logger interface

we are now ready to make the sdk a separate module

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-01-04 16:07:41 +01:00
parent a6fe802370
commit 2912b2e92e
30 changed files with 225 additions and 134 deletions

View File

@@ -3,7 +3,7 @@ package plugin
import (
"github.com/shirou/gopsutil/v3/process"
"github.com/drakkan/sftpgo/v2/logger"
"github.com/drakkan/sftpgo/v2/sdk/logger"
)
func killProcess(processPath string) {
@@ -16,10 +16,10 @@ func killProcess(processPath string) {
if err == nil {
if cmdLine == processPath {
err = p.Kill()
logger.Debug(logSender, "", "killed process %v, pid %v, err %v", cmdLine, p.Pid, err)
logger.Debug(logSender, "killed process %v, pid %v, err %v", cmdLine, p.Pid, err)
return
}
}
}
logger.Debug(logSender, "", "no match for plugin process %v", processPath)
logger.Debug(logSender, "no match for plugin process %v", processPath)
}