github.com/cloudfoundry/cli@v7.1.0+incompatible/actor/v3action/logcache.go (about)

     1  package v3action
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  // LogCacheURL gets the log-cache URL, either directly from ccClientV3.Info, or by
     8  // getting the target and s/api/logcache/
     9  // This works around the bug logged in story https://www.pivotaltracker.com/story/show/170138644
    10  
    11  func (actor Actor) LogCacheURL() string {
    12  	info, _, _, err := actor.CloudControllerClient.GetInfo()
    13  	if err == nil {
    14  		logCacheURL := info.LogCache()
    15  		if logCacheURL != "" {
    16  			return logCacheURL
    17  		}
    18  	}
    19  	return strings.Replace(actor.Config.Target(), "api", "log-cache", 1)
    20  }