MCPcopy
hub / github.com/CodisLabs/codis / LogLevel

Method LogLevel

pkg/proxy/proxy_api.go:181–195  ·  view source on GitHub ↗
(params martini.Params)

Source from the content-addressed store, hash-verified

179}
180
181func (s *apiServer) LogLevel(params martini.Params) (int, string) {
182 if err := s.verifyXAuth(params); err != nil {
183 return rpc.ApiResponseError(err)
184 }
185 v := params["value"]
186 if v == "" {
187 return rpc.ApiResponseError(errors.New("missing loglevel"))
188 }
189 if !log.SetLevelString(v) {
190 return rpc.ApiResponseError(errors.New("invalid loglevel"))
191 } else {
192 log.Warnf("set loglevel to %s", v)
193 return rpc.ApiResponseJson("OK")
194 }
195}
196
197func (s *apiServer) Shutdown(params martini.Params) (int, string) {
198 if err := s.verifyXAuth(params); err != nil {

Callers 2

handleLogLevelMethod · 0.45
handleLogLevelMethod · 0.45

Calls 3

verifyXAuthMethod · 0.95
SetLevelStringMethod · 0.80
WarnfMethod · 0.80

Tested by

no test coverage detected