private static void Debug(string stuff) { if (DebugFlags.Get("authapi_debug")) { Log.Error(stuff); } }
private static void HandleFlagRequest(string path, IHttpResponseDelegate response) { var comp = path.Split('/').Last(); var result = DebugFlags.Toggle(comp); var responseText = string.Format("{0} is now {1}.", comp, result); var responseBytes = Encoding.ASCII.GetBytes(responseText); response.OnResponse(new HttpResponseHead() { Status = "200 OK", Headers = new Dictionary <string, string>() { { "Content-Length", responseBytes.Length.ToString() }, { "Content-Type", "text/plain" } } }, new BufferedProducer(responseBytes)); }