create log later in processing (closes #177)
This commit is contained in:
parent
a1e0f08408
commit
031d9b914e
@ -30,6 +30,8 @@ func doAnalyzeCmd(cmd *cobra.Command, args []string) {
|
||||
utils.Exit(1)
|
||||
}
|
||||
|
||||
initLogging()
|
||||
|
||||
runtime.Run(runtime.Options{
|
||||
ImageId: userImage,
|
||||
ExportFile: exportFile,
|
||||
|
@ -22,6 +22,8 @@ func init() {
|
||||
func doBuildCmd(cmd *cobra.Command, args []string) {
|
||||
defer utils.Cleanup()
|
||||
|
||||
initLogging()
|
||||
|
||||
runtime.Run(runtime.Options{
|
||||
BuildArgs: args,
|
||||
ExportFile: exportFile,
|
||||
|
@ -40,7 +40,6 @@ func Execute() {
|
||||
|
||||
func init() {
|
||||
cobra.OnInitialize(initConfig)
|
||||
cobra.OnInitialize(initLogging)
|
||||
|
||||
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.dive.yaml, ~/.config/dive.yaml, or $XDG_CONFIG_HOME/dive.yaml)")
|
||||
rootCmd.PersistentFlags().BoolP("version", "v", false, "display version number")
|
||||
|
@ -1,5 +1,9 @@
|
||||
package filetree
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type TreeCacheKey struct {
|
||||
bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop int
|
||||
}
|
||||
@ -24,7 +28,10 @@ func (cache *TreeCache) Get(bottomTreeStart, bottomTreeStop, topTreeStart, topTr
|
||||
func (cache *TreeCache) buildTree(key TreeCacheKey) *FileTree {
|
||||
newTree := StackTreeRange(cache.refTrees, key.bottomTreeStart, key.bottomTreeStop)
|
||||
for idx := key.topTreeStart; idx <= key.topTreeStop; idx++ {
|
||||
newTree.CompareAndMark(cache.refTrees[idx])
|
||||
err := newTree.CompareAndMark(cache.refTrees[idx])
|
||||
if err != nil {
|
||||
logrus.Errorf("unable to build tree: %+v", err)
|
||||
}
|
||||
}
|
||||
return newTree
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user