Skip to content

Commit

Permalink
fix logger
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLYC committed Nov 23, 2021
1 parent ddeb7c7 commit 2c291e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ func (d *Downloader) Run(ctx context.Context) (context.Context, error) {

location := filepath.Join(d.tempDir, name)

logger.Debug("downloading command", map[string]interface{}{
"url": url,
"target": location,
logger.Info("downloading", map[string]interface{}{
"url": url,
"name": name,
})
err = utils.DownloadToFile(ctx, url, location)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion core/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (r *ReleaseSearcher) String() string {

func (r *ReleaseSearcher) Run(ctx context.Context) (context.Context, error) {
logger := define.Logger
logger.Debug("searching cmdr release", map[string]interface{}{
logger.Info("searching cmdr release", map[string]interface{}{
"release": r.release,
"asset": r.asset,
})
Expand Down Expand Up @@ -53,6 +53,10 @@ func (r *ReleaseSearcher) Run(ctx context.Context) (context.Context, error) {
return ctx, errors.Wrapf(ErrAssetNotFound, "cmdr release not found: %s", r.asset)
}

logger.Info("cmdr release found", map[string]interface{}{
"release": version,
"url": url,
})
return utils.SetIntoContext(ctx, map[define.ContextKey]interface{}{
define.ContextKeyVersion: version,
define.ContextKeyLocation: url,
Expand Down

0 comments on commit 2c291e3

Please sign in to comment.