summaryrefslogtreecommitdiff
path: root/cleaner.go
diff options
context:
space:
mode:
Diffstat (limited to 'cleaner.go')
-rw-r--r--cleaner.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/cleaner.go b/cleaner.go
index 5e0e7d0..1342798 100644
--- a/cleaner.go
+++ b/cleaner.go
@@ -19,7 +19,9 @@ func init() {
}
func cleanFromDB(cfg *Config) (rowsLeft int, err error) {
- cllogger.Println("Starting to clean from db...")
+ if VERBOSE {
+ cllogger.Println("Starting to clean from db...")
+ }
db, err := sql.Open("mysql", cfg.DBUser+":"+cfg.DBPass+"@"+cfg.DBConn+"/"+cfg.DBName)
if err != nil {
@@ -83,12 +85,16 @@ func cleanFromDB(cfg *Config) (rowsLeft int, err error) {
}
tx.Commit()
- cllogger.Println("Finished cleaning from db!")
+ if VERBOSE {
+ cllogger.Println("Finished cleaning from db!")
+ }
return
}
func cleanFromStdin(rDatChan <-chan []RawData, cfg *Config) error {
- cllogger.Println("Starting to clean from stdin...")
+ if VERBOSE {
+ cllogger.Println("Starting to clean from stdin...")
+ }
for rDat := range rDatChan {
cDat, err := clean(rDat, cfg)
if err != nil {
@@ -103,7 +109,9 @@ func cleanFromStdin(rDatChan <-chan []RawData, cfg *Config) error {
continue
}
}
- cllogger.Println("Finished cleaning from stdin!")
+ if VERBOSE {
+ cllogger.Println("Finished cleaning from stdin!")
+ }
return nil
}