Skip to content

Commit

Permalink
add logging to process_tpps.go and update SilenceUsage to false for p…
Browse files Browse the repository at this point in the history
…rocessTPPSCommand
  • Loading branch information
traskowskycaci committed Jan 20, 2025
1 parent 3f5e66d commit 65399c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/milmove-tasks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func main() {
Short: "process TPPS files asynchrounously",
Long: "process TPPS files asynchrounously",
RunE: processTPPS,
SilenceUsage: true,
SilenceUsage: false,
}
initProcessTPPSFlags(processTPPSCommand.Flags())
root.AddCommand(processTPPSCommand)
Expand Down
6 changes: 5 additions & 1 deletion cmd/milmove-tasks/process_tpps.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func initProcessTPPSFlags(flag *pflag.FlagSet) {
}

func processTPPS(_ *cobra.Command, _ []string) error {

v := viper.New()

logger, _, err := logging.Config(
Expand All @@ -72,6 +73,9 @@ func processTPPS(_ *cobra.Command, _ []string) error {
if err != nil {
logger.Fatal("Failed to initialized Zap logging for process-tpps")
}

logger.Info("Reaching process_tpps.go line 78")

zap.ReplaceGlobals(logger)

startTime := time.Now()
Expand Down Expand Up @@ -147,7 +151,7 @@ func processTPPS(_ *cobra.Command, _ []string) error {
previousDay := yesterday.Format("20220702")
tppsFilename = fmt.Sprintf("MILMOVE-en%s.csv", previousDay)
previousDayFormatted := yesterday.Format("July 02, 2022")
appCtx.Logger().Info(fmt.Sprintf("Starting transfer of TPPS data for %s: %s\n", previousDayFormatted, tppsFilename))
logger.Info(fmt.Sprintf("Starting transfer of TPPS data for %s: %s\n", previousDayFormatted, tppsFilename))
} else {
// if customFilePathToProcess != MILMOVE-enYYYYMMDD.csv (meaning we have given an ACTUAL specific filename we want processed instead of placeholder MILMOVE-enYYYYMMDD.csv)
// then append customFilePathToProcess to the s3 bucket path and process that INSTEAD OF
Expand Down

0 comments on commit 65399c1

Please sign in to comment.