[REV] Add debug log in ftp

This commit is contained in:
pujielan 2018-02-26 10:28:44 +08:00
parent 414f4da9d2
commit 67885ad7e3
2 changed files with 3 additions and 2 deletions

View File

@ -71,7 +71,7 @@ func NewSlugShareItem(in []byte) *SlugShareItem {
logger := event.GetManager().GetLogger(eventID)
sf := SlugFTPConf {
Username: gjson.GetBytes(in, "share_conf.ftp_username").String(),
Password: gjson.GetBytes(in, "share_conf.ftp_username").String(),
Password: gjson.GetBytes(in, "share_conf.ftp_password").String(),
Host: gjson.GetBytes(in, "share_conf.ftp_host").String(),
Port: int(gjson.GetBytes(in, "share_conf.ftp_port").Int()),
FTPNamespace: gjson.GetBytes(in, "share_conf.ftp_namespace").String(),
@ -139,7 +139,7 @@ func (i *SlugShareItem)ShareToYS(file string)error {
//UploadFtp UploadFt
func (i *SlugShareItem)UploadFtp(path, file, md5 string) error {
i.Logger.Info(fmt.Sprintf("开始上传代码包: %s", file), map[string]string{"step":"slug-share"})
ftp := sources.NewFTPManager(i.FTPConf.Username, i.FTPConf.Password, i.FTPConf.Host)
ftp := sources.NewFTPManager(i.FTPConf.Username, i.FTPConf.Password, i.FTPConf.Host, i.FTPConf.Port)
sc, err := ftp.LoginFTP(i.Logger)
if err != nil {
return err

View File

@ -59,6 +59,7 @@ func (f *FTPBase)LoginFTP(logger event.Logger) (*ftp.ServerConn, error){
logger.Error("ftp服务器连接错误", map[string]string{"step":"slug-share", "status":"failure"})
return nil, err
}
logrus.Debugf("user name is %s, password is %s", f.UserName, f.PassWord)
if err := sc.Login(f.UserName, f.PassWord); err != nil {
logger.Error("ftp服务器登录错误", map[string]string{"step":"slug-share", "status":"failure"})
return nil, err