Esempio n. 1
0
// ログを書き換える
func SetLogger(logPath string) {
	if logger != nil {
		logger.Close()
	}
	logger = logging.NewLogger(logPath, logging.DEBUG)
}
Esempio n. 2
0
	"os"
	"syscall"
)

type WebApiServer struct {
	listenAddr string
	server     *http.ServeMux
	context    *goron.Goron
	listener   *net.Listener
}

type JobsResponse map[string][]string

type StatusesResponse map[string]map[string]string

var logger = logging.NewLogger("", logging.DEBUG)

func NewWebApiServer(addr string, context *goron.Goron) (*WebApiServer, error) {
	server := &WebApiServer{
		listenAddr: addr,
		server:     http.NewServeMux(),
		context:    context,
	}

	return server, nil
}

// ログを書き換える
func SetLogger(logPath string) {
	if logger != nil {
		logger.Close()