func init() { logs.Init(true) if err := config.Init("../config.json", 0); err != nil { fmt.Printf("Error loading config file: %s\n", err) } if err := data.Init("../data.json"); err != nil { fmt.Printf("Error loading config file: %s\n", err) } }
func init() { var port int64 flag.BoolVar(&Debug, "debug", false, "Activate debug prints to the console. Active if either this or the value in 'config.json' are set.") flag.Int64Var(&port, "port", 0, "Port. If set, this flag will override the value in 'config.json'.") flag.Parse() logs.Init(Debug) if err := config.Init("config.json", port); err != nil { log.Error("Error loading config file: %s\n", err) } if err := data.Init("data.json"); err != nil { log.Error("Error loading config file: %s\n", err) } log.Info("Running on port: %d", config.Port()) go SignalHandler(make(chan os.Signal, 1)) fmt.Println("Press Ctrl-C to shutdown...") }
func init() { logs.Init(true) }