add logging

This commit is contained in:
dom 2020-07-18 09:22:44 +02:00
parent 880d06b1b8
commit 1adfc456be
1 changed files with 6 additions and 0 deletions

View File

@ -1,7 +1,9 @@
package paxan
import (
"fmt"
"io"
"log"
"os"
"path/filepath"
"time"
@ -28,6 +30,8 @@ func DownloadFTP(user string, password string, path string) error {
return err
}
fmt.Printf("%v", files)
for _, file := range files {
res, err := c.Retr(file.Name)
if err != nil {
@ -35,6 +39,8 @@ func DownloadFTP(user string, password string, path string) error {
}
defer res.Close()
log.Printf("Downloading %s", file.Name)
outFile, err := os.Create(filepath.Join(path, file.Name))
if err != nil {
return err