mirror of https://bitbucket.org/ausocean/av.git
revid: setting revid's config in revid.New
This commit is contained in:
parent
9769a3c4a9
commit
fe49be41ad
|
@ -119,6 +119,11 @@ type Revid struct {
|
||||||
// an error if construction of the new instance was not successful.
|
// an error if construction of the new instance was not successful.
|
||||||
func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
||||||
r := Revid{ns: ns, err: make(chan error)}
|
r := Revid{ns: ns, err: make(chan error)}
|
||||||
|
err := r.setConfig(c)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("could not set config, failed with error: %v",err)
|
||||||
|
}
|
||||||
|
r.config.Logger.SetLevel(c.LogLevel)
|
||||||
go r.handleErrors()
|
go r.handleErrors()
|
||||||
return &r, nil
|
return &r, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue