feat(plugins): better logging and handling of loading plugins, try to create plugins dir if it does not exist, fixes #3974

This commit is contained in:
Torkel Ödegaard
2016-02-10 11:03:12 +01:00
parent 509b37eb91
commit 257b824d4f
8 changed files with 53 additions and 34 deletions

View File

@ -6,7 +6,6 @@ import (
"path/filepath"
"strings"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/util"
)
@ -38,13 +37,10 @@ func (fp *FrontendPluginBase) initFrontendPlugin() {
}
func (fp *FrontendPluginBase) setPathsBasedOnApp(app *AppPlugin) {
// log.Info("Module Before: %v", fp.Module)
// find out plugins path relative to app static root
appSubPath := strings.Replace(fp.PluginDir, app.StaticRootAbs, "", 1)
fp.IncludedInAppId = app.Id
fp.BaseUrl = app.BaseUrl
fp.Module = util.JoinUrlFragments("plugins/"+app.Id, appSubPath) + "/module"
log.Info("setting paths based on app: subpath = %v, module: %v", appSubPath, fp.Module)
}
func (fp *FrontendPluginBase) handleModuleDefaults() {