func NewClient(
	cfg *Config, db *reform.DB, log Log, version string) (*Client, error) {
	if log == nil {
		return nil, fmt.Errorf("no log object specified")
	}

	excludedPackagesMap := make(map[string]bool)

	for _, pkg := range cfg.ExcludedPackages {
		excludedPackagesMap[pkg] = true
	}

	pkgSlice, err := pkgList(excludedPackagesMap)
	if err != nil {
		return nil, err
	}

	bugsnag.Configure(bugsnag.Configuration{
		APIKey:              currentAPIKey,
		Logger:              log,
		PanicHandler:        func() {}, // we use our panic processor
		ProjectPackages:     pkgSlice,
		ReleaseStage:        cfg.ReleaseStage,
		NotifyReleaseStages: []string{production, staging},
		AppVersion:          version,
	})

	cli := new(Client)
	cli.db = db
	cli.logger = log
	cli.notifier = bugsnag.New(user(cfg.UserID))

	//check enable service
	e := cli.allowed()
	cli.enable = e
	enable = e
	notifier = cli.notifier
	return cli, nil
}
func NewClient(
	cfg *Config, db *reform.DB, log Log, version string) (*Client, error) {
	if log == nil {
		return nil, fmt.Errorf("no log object specified")
	}

	excludedPackagesMap := make(map[string]bool)

	for _, pkg := range cfg.ExcludedPackages {
		excludedPackagesMap[pkg] = true
	}

	pkgSlice, err := pkgList(excludedPackagesMap)
	if err != nil {
		return nil, err
	}

	bugsnag.Configure(bugsnag.Configuration{
		APIKey:              currentAPIKey,
		Logger:              log,
		PanicHandler:        func() {}, // we use our panic processor
		ProjectPackages:     pkgSlice,
		ReleaseStage:        cfg.ReleaseStage,
		NotifyReleaseStages: []string{production, staging},
		AppVersion:          version,
	})

	cli := new(Client)
	cli.db = db
	cli.logger = log
	cli.notifier = bugsnag.New(user(cfg.UserID))

	//check enable service
	e := cli.allowed()
	cli.enable = e
	enable = e
	notifier = cli.notifier
	return cli, nil
}
func NewClient ( cfg * Config , db * reform . DB , log Log , version string ) ( * Client , error ) { if log == nil { return nil , fmt . Errorf ( " " ) } excludedPackagesMap := make ( map [ string ] bool ) for _ , pkg := range cfg . ExcludedPackages { excludedPackagesMap [ pkg ] = true } pkgSlice , err := pkgList ( excludedPackagesMap ) if err != nil { return nil , err } bugsnag . Configure ( bugsnag . Configuration { APIKey : currentAPIKey , Logger : log , PanicHandler : func ( ) { } , // we use our panic processor ProjectPackages : pkgSlice , ReleaseStage : cfg . ReleaseStage , NotifyReleaseStages : [ ] string { production , staging } , AppVersion : version , } ) cli := new ( Client ) cli . db = db cli . logger = log cli . notifier = bugsnag . New ( user ( cfg . UserID ) ) //check enable service e := cli . allowed ( ) cli . enable = e enable = e notifier = cli . notifier return cli , nil }
// NewClient initializing Bugsnag client.
// Bugsnag client that automatic error sender to remote server.
// We use this service to collect anonymous information
// about the error and panic.
// Service is activated if exist entry key = "error.sendremote"
// and value = true in the database settings table.
NewClient initializing Bugsnag client . Bugsnag client that automatic error sender to remote server . We use this service to collect anonymous information about the error and panic . Service is activated if exist entry key = error . sendremote and value = true in the database settings table .