Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nevir committed Mar 31, 2020
1 parent d6c997b commit 3c73c70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/Vilsol/ue4pak/parser"
"github.com/fatih/color"
log "github.com/sirupsen/logrus"

"github.com/gobwas/glob"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -75,8 +76,12 @@ var extractCmd = &cobra.Command{
panic(err)
}

log.Infof("Writing Result: %s\n", destination)
resultBytes := formatResults(entry)
ioutil.WriteFile(destination, resultBytes, 0644)
err = ioutil.WriteFile(destination, resultBytes, 0644)
if err != nil {
panic(err)
}
} else {
results = append(results, entry)
}
Expand Down
2 changes: 1 addition & 1 deletion parser/parser_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (parser *PakParser) ProcessPak(parseFile func(string) bool, handleEntry fun

if strings.HasSuffix(trimmed, "uasset") {
offset := record.FileOffset + pak.Footer.HeaderSize()
log.Infof("Reading Record: %d [%x-%x]: %s\n", j, offset, offset+record.FileSize, trimmed)
log.Infof("Reading Summary: %d [%x-%x]: %s\n", j, offset, offset+record.FileSize, trimmed)
summaries[trimmed[0:strings.Index(trimmed, ".uasset")]] = record.ReadUAsset(pak, parser)
summaries[trimmed[0:strings.Index(trimmed, ".uasset")]].Record = record
}
Expand Down

0 comments on commit 3c73c70

Please sign in to comment.