mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
chore(cache): add more logging
This commit is contained in:
parent
e79db4a3b6
commit
2aa10619b4
|
@ -202,6 +202,7 @@ func (segment *Segment) hasCache() bool {
|
||||||
func (segment *Segment) isToggled() bool {
|
func (segment *Segment) isToggled() bool {
|
||||||
toggles, OK := segment.env.Session().Get(cache.TOGGLECACHE)
|
toggles, OK := segment.env.Session().Get(cache.TOGGLECACHE)
|
||||||
if !OK || len(toggles) == 0 {
|
if !OK || len(toggles) == 0 {
|
||||||
|
log.Debug("no toggles found")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,6 +224,7 @@ func (segment *Segment) restoreCache() bool {
|
||||||
|
|
||||||
data, OK := segment.env.Session().Get(segment.cacheKey())
|
data, OK := segment.env.Session().Get(segment.cacheKey())
|
||||||
if !OK {
|
if !OK {
|
||||||
|
log.Debug("no cache found for segment: ", segment.Name())
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +236,8 @@ func (segment *Segment) restoreCache() bool {
|
||||||
segment.Enabled = true
|
segment.Enabled = true
|
||||||
template.Cache.AddSegmentData(segment.Name(), segment.writer)
|
template.Cache.AddSegmentData(segment.Name(), segment.writer)
|
||||||
|
|
||||||
|
log.Debug("restored segment from cache: ", segment.Name())
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
runtime_ "runtime"
|
runtime_ "runtime"
|
||||||
|
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/cache"
|
"github.com/jandedobbeleer/oh-my-posh/src/cache"
|
||||||
|
"github.com/jandedobbeleer/oh-my-posh/src/log"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/properties"
|
"github.com/jandedobbeleer/oh-my-posh/src/properties"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/regex"
|
"github.com/jandedobbeleer/oh-my-posh/src/regex"
|
||||||
"github.com/jandedobbeleer/oh-my-posh/src/runtime"
|
"github.com/jandedobbeleer/oh-my-posh/src/runtime"
|
||||||
|
@ -212,6 +213,7 @@ func (l *language) setVersion() error {
|
||||||
var version version
|
var version version
|
||||||
err := json.Unmarshal([]byte(versionCache), &version)
|
err := json.Unmarshal([]byte(versionCache), &version)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
log.Debugf("version cache restored for %s: %s", l.name, version)
|
||||||
l.version = version
|
l.version = version
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue