Skip to content

Commit

Permalink
added more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov committed Oct 17, 2023
1 parent e6e748f commit 8e6ca6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions publish/hep.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (h *HEPOutputer) copyHEPFileOut(n int) (int, error) {

if _, err := os.Stat(config.Cfg.HEPBufferFile); err != nil {
logp.Debug("file doesn't exists: ", config.Cfg.HEPBufferFile)
return 0, fmt.Errorf("file doesn't exists")
return 0, fmt.Errorf("file doesn't exists: ", config.Cfg.HEPBufferFile)
}

HEPFileData, HEPFileDataerr := os.ReadFile(config.Cfg.HEPBufferFile)
Expand Down Expand Up @@ -226,7 +226,8 @@ func (h *HEPOutputer) copyHEPbufftoFile(inbytes []byte) (int64, error) {

destination, err := os.OpenFile(config.Cfg.HEPBufferFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
if err != nil {
fmt.Println("Open HEP file error", err)
logp.Err("open HEP file error: %v\n", err)
return 0, fmt.Errorf("open HEP file error: %v", err)
}

defer destination.Close()
Expand All @@ -247,7 +248,8 @@ func (h *HEPOutputer) copyHEPbufftoFile(inbytes []byte) (int64, error) {
nBytes, err := destination.Write(inbytes)

if err != nil {
logp.Debug("collector", "File Send HEP from buffer to file error", err)
logp.Err("file Send HEP from buffer to file error: %v", err.Error())
return 0, fmt.Errorf("file Send HEP from buffer to file error: %v", err.Error())
} else {
logp.Debug("collector", " File Send HEP from buffer to file OK")
}
Expand Down

0 comments on commit 8e6ca6a

Please sign in to comment.