func listMocks(args []string) { var service = "" // Suppress observer logging log.Set(os.DevNull, 0) if len(args) != 0 { service = args[0] } observer := rules.NewObserver(knf.GetS(DATA_RULE_DIR)) err := listing.List(observer, service) if err != nil { printError(err.Error()) os.Exit(1) } }
func setupLog() { var err error if arg.GetB(ARG_DAEMON) { err = log.Set(knf.GetS(LOG_FILE), knf.GetM(LOG_PERMS, 0644)) if err != nil { fmt.Printf("Can't setup logger: %v\n", err) os.Exit(1) } } err = log.MinLevel(knf.GetS(LOG_LEVEL, "info")) if err != nil { fmt.Printf("Can't set log level: %v\n", err) } }