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) log.Info("proto.Marshal() failed len", len(data), err)
return 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() s := f.FormatTEXT()
configWrite("forge.text", []byte(s)) configWrite("forge.text", []byte(s))

View File

@ -7,7 +7,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"log"
"os" "os"
"path/filepath" "path/filepath"
"time" "time"
@ -15,12 +14,8 @@ import (
func backupConfig() error { func backupConfig() error {
// make a new dir to backup the files // 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")) 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) return backupFiles(srcDir, destDir)
} }
@ -44,7 +39,7 @@ func backupFiles(srcDir string, destDir string) error {
continue continue
} }
log.Println("backing up file", entry.Name()) // log.Println("backing up file", entry.Name())
srcPath := filepath.Join(srcDir, entry.Name()) srcPath := filepath.Join(srcDir, entry.Name())
destPath := filepath.Join(destDir, entry.Name()) destPath := filepath.Join(destDir, entry.Name())
@ -64,6 +59,9 @@ func copyFile(src, dest string) error {
} }
defer srcFile.Close() 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) destFile, err := os.Create(dest)
if err != nil { if err != nil {
return err return err