Skip to content

Commit

Permalink
chore: use logger.PrintXX instead of fmt.PrintXX
Browse files Browse the repository at this point in the history
Use logger for printing output instead of raw output to Stdout which
causes issues with running tests.
  • Loading branch information
stevenh committed Feb 20, 2024
1 parent c84e479 commit 9336421
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func tarDir(src string, fileMode int64) (*bytes.Buffer, error) {

buffer := &bytes.Buffer{}

fmt.Printf(">> creating TAR file from directory: %s\n", src)
Logger.Printf(">> creating TAR file from directory: %s\n", src)

// tar > gzip > buffer
zr := gzip.NewWriter(buffer)
Expand All @@ -59,7 +59,7 @@ func tarDir(src string, fileMode int64) (*bytes.Buffer, error) {

// if a symlink, skip file
if fi.Mode().Type() == os.ModeSymlink {
fmt.Printf(">> skipping symlink: %s\n", file)
Logger.Printf(">> skipping symlink: %s\n", file)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (opt CustomizeRequestOption) Customize(req *GenericContainerRequest) {
func CustomizeRequest(src GenericContainerRequest) CustomizeRequestOption {
return func(req *GenericContainerRequest) {
if err := mergo.Merge(req, &src, mergo.WithOverride, mergo.WithAppendSlice); err != nil {
fmt.Printf("error merging container request, keeping the original one. Error: %v", err)
Logger.Printf("error merging container request, keeping the original one. Error: %v", err)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion wait/host_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (hp *HostPortStrategy) WaitUntilReady(ctx context.Context, target StrategyT
}
port, err = target.MappedPort(ctx, internalPort)
if err != nil {
fmt.Printf("(%d) [%s] %s\n", i, port, err)
log.Printf("(%d) [%s] %s\n", i, port, err)
}
}
}
Expand Down

0 comments on commit 9336421

Please sign in to comment.