etcdserver/api/etcdhttp/base.go
func logHandleFunc(w http.ResponseWriter, r *http.Request) {
	if !allowMethod(w, r, "PUT") {
		return
	}

	in := struct{ Level string }{}

	d := json.NewDecoder(r.Body)
	if err := d.Decode(&in); err != nil {
		WriteError(nil, w, r, httptypes.NewHTTPError(http.StatusBadRequest, "Invalid json body"))
		return
	}

	logl, err := capnslog.ParseLevel(strings.ToUpper(in.Level))
	if err != nil {
		WriteError(nil, w, r, httptypes.NewHTTPError(http.StatusBadRequest, "Invalid log level "+in.Level))
		return
	}

	plog.Noticef("globalLogLevel set to %q", logl.String())
	capnslog.SetGlobalLogLevel(logl)
	w.WriteHeader(http.StatusNoContent)
}
func logHandleFunc(w http.ResponseWriter, r *http.Request) {
	if !allowMethod(w, r, "PUT") {
		return
	}

	in := struct{ Level string }{}

	d := json.NewDecoder(r.Body)
	if err := d.Decode(&in); err != nil {
		WriteError(nil, w, r, httptypes.NewHTTPError(http.StatusBadRequest, "Invalid json body"))
		return
	}

	logl, err := capnslog.ParseLevel(strings.ToUpper(in.Level))
	if err != nil {
		WriteError(nil, w, r, httptypes.NewHTTPError(http.StatusBadRequest, "Invalid log level "+in.Level))
		return
	}

	plog.Noticef("globalLogLevel set to %q", logl.String())
	capnslog.SetGlobalLogLevel(logl)
	w.WriteHeader(http.StatusNoContent)
}
func logHandleFunc ( w http . ResponseWriter , r * http . Request ) { if ! allowMethod ( w , r , " " ) { return } in := struct { Level string } { } d := json . NewDecoder ( r . Body ) if err := d . Decode ( & in ) ; err != nil { WriteError ( nil , w , r , httptypes . NewHTTPError ( http . StatusBadRequest , " " ) ) return } logl , err := capnslog . ParseLevel ( strings . ToUpper ( in . Level ) ) if err != nil { WriteError ( nil , w , r , httptypes . NewHTTPError ( http . StatusBadRequest , " " + in . Level ) ) return } plog . Noticef ( " " , logl . String ( ) ) capnslog . SetGlobalLogLevel ( logl ) w . WriteHeader ( http . StatusNoContent ) }
// TODO: deprecate '/config/local/log' in v3.5
TODO : deprecate / config / local / log in v3 . 5