Esempio n. 1
0
File: main.go Progetto: 2722/lantern
func logPanic(msg string) {
	cfg, err := config.Init(flashlight.PackageVersion, *configdir, *stickyConfig, flagsAsMap())
	if err != nil {
		panic("Error initializing config")
	}
	if err := logging.EnableFileLogging(); err != nil {
		panic("Error initializing logging")
	}

	<-logging.Configure(eventual.DefaultGetter(""), "", cfg.Client.DeviceID, flashlight.Version, flashlight.RevisionDate)

	log.Error(msg)

	logging.Flush()
	_ = logging.Close()
}
Esempio n. 2
0
func Configure(addr string, trackingId string, version string, proxyAddr string) {
	ip = addr
	var err error
	go func() {
		httpClient, err = util.HTTPClient("", eventual.DefaultGetter(proxyAddr))
		if err != nil {
			log.Errorf("Could not create HTTP client via %s: %s", proxyAddr, err)
			return
		}
		// Store new session info whenever client proxy is ready
		if status, err := sessionEvent(trackingId, version); err != nil {
			log.Errorf("Unable to store new session info: %v", err)
		} else {
			log.Tracef("Storing new session info: %v", status)
		}
	}()
}