mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 00:41:08 +08:00
feat(logging): a lot of progress on moving to new logging lib, #4590
This commit is contained in:
@ -25,6 +25,7 @@ var (
|
||||
|
||||
GrafanaLatestVersion string
|
||||
GrafanaHasUpdate bool
|
||||
plog log.Logger
|
||||
)
|
||||
|
||||
type PluginScanner struct {
|
||||
@ -33,6 +34,8 @@ type PluginScanner struct {
|
||||
}
|
||||
|
||||
func Init() error {
|
||||
plog = log.New("plugins")
|
||||
|
||||
DataSources = make(map[string]*DataSourcePlugin)
|
||||
StaticRoutes = make([]*PluginStaticRoute, 0)
|
||||
Panels = make(map[string]*PanelPlugin)
|
||||
@ -44,16 +47,16 @@ func Init() error {
|
||||
"app": AppPlugin{},
|
||||
}
|
||||
|
||||
log.Info("Plugins: Scan starting")
|
||||
plog.Info("Starting plugin search")
|
||||
scan(path.Join(setting.StaticRootPath, "app/plugins"))
|
||||
|
||||
// check if plugins dir exists
|
||||
if _, err := os.Stat(setting.PluginsPath); os.IsNotExist(err) {
|
||||
log.Warn("Plugins: Plugin dir %v does not exist", setting.PluginsPath)
|
||||
plog.Warn("Plugin dir does not exist", "dir", setting.PluginsPath)
|
||||
if err = os.MkdirAll(setting.PluginsPath, os.ModePerm); err != nil {
|
||||
log.Warn("Plugins: Failed to create plugin dir: %v, error: %v", setting.PluginsPath, err)
|
||||
plog.Warn("Failed to create plugin dir", "dir", setting.PluginsPath, "error", err)
|
||||
} else {
|
||||
log.Info("Plugins: Plugin dir %v created", setting.PluginsPath)
|
||||
plog.Info("Plugin dir created", "dir", setting.PluginsPath)
|
||||
scan(setting.PluginsPath)
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user