turn of the verbose logging

This commit is contained in:
Jeff Carr 2025-01-29 01:01:22 -06:00
parent 667257595d
commit 0efc3c67ca
2 changed files with 6 additions and 8 deletions

View File

@ -43,7 +43,7 @@ func (f *ForgeConfigs) ConfigSave() error {
log.Info("proto.Marshal() failed len", len(data), err)
return err
}
log.Info("forgepb.ConfigSave() proto.Marshal() worked len", len(data))
// log.Info("forgepb.ConfigSave() proto.Marshal() worked len", len(data))
s := f.FormatTEXT()
configWrite("forge.text", []byte(s))

View File

@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"io"
"log"
"os"
"path/filepath"
"time"
@ -15,12 +14,8 @@ import (
func backupConfig() error {
// make a new dir to backup the files
now := time.Now()
// timestamp := now.Format("2022.07.18.190545") // 50yr shout out to K&R
timestamp := now.Format("2006.01.02.150405") // bummer. other date doesn't work?
srcDir := filepath.Join(os.Getenv("FORGE_CONFIG"))
destDir := filepath.Join(os.Getenv("FORGE_CONFIG"), timestamp)
destDir := filepath.Join(os.Getenv("FORGE_CONFIG"), "backup")
return backupFiles(srcDir, destDir)
}
@ -44,7 +39,7 @@ func backupFiles(srcDir string, destDir string) error {
continue
}
log.Println("backing up file", entry.Name())
// log.Println("backing up file", entry.Name())
srcPath := filepath.Join(srcDir, entry.Name())
destPath := filepath.Join(destDir, entry.Name())
@ -64,6 +59,9 @@ func copyFile(src, dest string) error {
}
defer srcFile.Close()
now := time.Now()
timestamp := now.Format("2006.01.02.150405") // bummer. other date doesn't work?
dest = dest + timestamp
destFile, err := os.Create(dest)
if err != nil {
return err