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