 cmd, nil
}

func serveMetrics() {
	http.Handle("/metrics", promhttp.Handler())
	http.ListenAndServe(":9350", nil)
	glog.V(2).Infoln("Startet listening for prometheus metrics requests")
}

func serveBackend(options *types.BackendOperatorOptions) {
	r := mux.NewRouter()
	if options.StaticsPath!= "" {
		glog.V(2).Infof("Service statics from %s", options.StaticsPath)
		fs := backend.MinifiedFileServer(http.Dir(options.StaticsPath))
		r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", fs))

		if _, err := os.Stat(options.StaticsPath + "/" + "favicon.ico"); os.IsNotExist(err) {
			r.PathPrefix("/favicon.ico").Handler(http.StripPrefix("/static/", fs))
		}

	}

	handler := &backend.BackendHandler{Options: options}
	r.HandleFunc("/auth", handler.IndexHandler)
	r.HandleFunc("/logout", handler.IndexHandler)
	r.HandleFunc("/", handler.IndexHandler)
	http.ListenAndServe(":8081", r)
	glog.V(2).Infoln("Startet listening for backend requests")
}

// Run the customization of the Tectonic assets
func Run(cmd *cobra.Command, options *types.BackendOperatorOptions) error {

	if options.OidcConfig.Enforce && (options.OidcConfig.Issuer == "" || options.OidcConfig.ClientID == "") {
		panic("You cannot enforce OIDC authentication without OIDC configuration")
	}

	configTags := make(map[string]string)
	if options.Namespace!= "" {
		configTags["Namespace"] = options.Namespace
	}
	if options.PrometheusEnabled || len(os.Getenv("PROMETHEUS_ENABLED")) > 0 {
		configTags["PrometheusEnabled"] = "true"
	}

	err := options.InitData()
	if err!= nil {
		return err
	}

	raven.Capture(&raven.Packet{Level: raven.INFO, Message: "Started Default Backend Operator"}, configTags)

	if options.PrometheusEnabled || len(os.Getenv("PROMETHEUS_ENABLED")) > 0 {
		go serveMetrics()
	}

	_ = helm.RefreshHelm(options)

	options.OidcConfig.InitProvider()

	// Start backend server:
	go serveBackend(options)

	// Relay OS signals to the chan
	signals := make(chan os.Signal)
	signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
	// Example: Create a new AppMontior & instantiate it in the cluster
	// am := operator.NewAppMonitor("my-app-monitor", 80, 2)
	// am.Instantiate(options.KubeConfig, options.Namespace)

	stop := make(chan struct{})

	watchIngressCntlr, err := operator.NewingressConfigController(options)

	if err!= nil {
		return err
	}
	go watchIngressCntlr.Start(stop)

	/*
		go cntlr.Start(stop)
	*/
	// Block until signaled to stop
	<-signals

	// Close the stop chan / shutdown the controller
	close(stop)

	glog.Infof("Shutting down Default Backend Operator...")
	raven.Capture(&raven.Packet{Level: raven.INFO, Message: "Stopped Default Backend Operator"}, map[string]string{})

	return nil
}

func checkErr(err error, handleErr func(string)) {
	if err == nil {
		return
	}

	raven.CaptureError(err, map[string]string{"operation": "checkErr"})

	handleErr(err.Error())
}
Q: v8: can't get calling function name in a functioncallback I want to make a log of every function called when i run a js script.
So i want to make a callback for all the functions in javascript like this:
global->Set(v8::String::NewFromUtf8(isolate, "print"), v8::FunctionTemplate::New(isolate, LogName));
global->Set(v8::String::NewFromUtf8(isolate, "eval"), v8::FunctionTemplate::New(isolate, LogName));
global->Set(v8::String::NewFromUtf8(isolate, "unescape"), v8::FunctionTemplate::New(isolate, LogName));

I define my function like this:
void LogName(const v8::FunctionCallbackInfo<v8::Value>& args) {
    v8::String::Utf8Value str_caller(args.Callee());   
    printf("%s", str_caller); 
}

This is printed when unescape is called: function unescape() { [native code] }
But if do:
object = v8::Handle<v8::Object>::Cast(context->Global()->Get(v8::String::NewFromUtf8(isolate, "String")));
object->Set(v8::String::NewFromUtf8(isolate, "fromCharCode"), v8::FunctionTemplate::New(isolate, LogName)->GetFunction());

This is printed when String.fromCharCode is called: function () { [native code] }
Why in the second example i don't have the functions name, like for example "fromCharCode"?

A: I'm still pretty new to V8 but have run into this exact same problem. I've found only one solution so far. I'm not sure if it is ideal, but there are no other solutions so here goes...
Notice the functions where getting the name works are where you are adding a FunctionTemplate value to an ObjectTemplate (that is presumably then used as the global template parameter when you create the Context).  Also notice in the ones that don't work you are trying to add a Function to the global Object for that existing Context, and this is when getting the Callee name fails (returns a blank string).
The only solution I've found so far is to keep a persistent handle to the ObjectTemplate you create for global scope, add the FunctionTemplate to that when you go to register your new function, and then create a new Context that uses that modified ObjectTemplate. After this then calls to the function will return the Callee name as desired.
To try to illustrate this with some code:
Isolate *gIsolate;
Persistent<ObjectTemplate> gTemplate;
Persistent<Context> gContext;

// Adds a new function to the global object template
void AddFunction(const char *name, FunctionCallback func)
{
    // Get global template
    Local<ObjectTemplate> global = ObjectTemplate::New(gIsolate, gTemplate);

    // Add new function to it
    global->Set(String::NewFromUtf8(gIsolate, name), FunctionTemplate::New(gIsolate, func));
}

void FirstTimeInit()
{
    gIsolate = Isolate::New();
    HandleScope handle_scope(gIsolate);
    Handle<ObjectTemplate> global = ObjectTemplate::New(gIsolate);

    // Store global template in persistent handle
    gTemplate.Reset(gIsolate, global);

    // Register starting functions
    AddFunction( "print", LogName );
    AddFunction( "eval", LogName );
    AddFunction( "unescape", LogName );

    // Create context
    Handle<Context> context = Context::New(gIsolate, NULL, global);

    gContext.Reset(gIsolate, context);
}

void AddOtherFunction()
{
    AddFunction( "fromCharCode", LogName );

    Local<ObjectTemplate> global = ObjectTemplate::New(gIsolate, gTemplate);

    // Create a new context from the modified global template
    Local<Context> newContext = Context::New(gIsolate, nil, global);

    // Update persistent context handle to reference the new one
    gContext.Reset(gIsolate, newContext);
}

Last weekend we had a March Madness party at our house. One of the girls brought a cookie bouquet that she made for this event. It was so cute I had to ask if I could post a photo of it on here.
Now, who’s watching the big game tonight? Who are you cheering on? I have to go with MSU as I’m a former Michigander, myself. Go Spartans!
Love the bouquet, but I am not watching. Did not watch? I don’t even know when the thing is. was