Set a log prefix for each plugin and remove go-dynect global log prefix (#6336)

This commit is contained in:
Chris Bednarski 2016-04-25 15:33:53 -07:00 committed by James Nugent
parent 991dc3f86f
commit e942a74def
2 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package command
import (
"fmt"
"log"
"strings"
@ -41,6 +42,8 @@ func (c *InternalPluginCommand) Run(args []string) int {
pluginType := args[0]
pluginName := args[1]
log.SetPrefix(fmt.Sprintf("%s-%s (internal) ", pluginName, pluginType))
switch pluginType {
case "provider":
pluginFunc, found := InternalProviders[pluginName]

View File

@ -18,6 +18,8 @@ import (
)
func main() {
// Override global prefix set by go-dynect during init()
log.SetPrefix("")
os.Exit(realMain())
}