set log level when init
This commit is contained in:
parent
e44ea73486
commit
b1c7d92c4d
|
@ -19,6 +19,7 @@ package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/yunify/qingcloud-sdk-go/config"
|
"github.com/yunify/qingcloud-sdk-go/config"
|
||||||
|
"github.com/yunify/qingcloud-sdk-go/logger"
|
||||||
"github.com/yunify/qingcloud-sdk-go/request"
|
"github.com/yunify/qingcloud-sdk-go/request"
|
||||||
"github.com/yunify/qingcloud-sdk-go/request/data"
|
"github.com/yunify/qingcloud-sdk-go/request/data"
|
||||||
)
|
)
|
||||||
|
@ -34,7 +35,7 @@ type QingCloudServiceProperties struct {
|
||||||
|
|
||||||
func Init(c *config.Config) (*QingCloudService, error) {
|
func Init(c *config.Config) (*QingCloudService, error) {
|
||||||
properties := &QingCloudServiceProperties{}
|
properties := &QingCloudServiceProperties{}
|
||||||
|
logger.SetLevel(c.LogLevel)
|
||||||
return &QingCloudService{Config: c, Properties: properties}, nil
|
return &QingCloudService{Config: c, Properties: properties}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"github.com/yunify/qingcloud-sdk-go/config"
|
"github.com/yunify/qingcloud-sdk-go/config"
|
||||||
"github.com/yunify/qingcloud-sdk-go/request"
|
"github.com/yunify/qingcloud-sdk-go/request"
|
||||||
"github.com/yunify/qingcloud-sdk-go/request/data"
|
"github.com/yunify/qingcloud-sdk-go/request/data"
|
||||||
|
"github.com/yunify/qingcloud-sdk-go/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
{{if $service.Description}}// {{$service.Name | camelCase}}Service: {{$service.Description}}{{end}}
|
{{if $service.Description}}// {{$service.Name | camelCase}}Service: {{$service.Description}}{{end}}
|
||||||
|
@ -37,7 +38,7 @@ type {{$service.Name | camelCase}}ServiceProperties struct {
|
||||||
|
|
||||||
func Init(c *config.Config) (*{{$service.Name | camelCase}}Service, error) {
|
func Init(c *config.Config) (*{{$service.Name | camelCase}}Service, error) {
|
||||||
properties := &{{$service.Name | camelCase}}ServiceProperties{}
|
properties := &{{$service.Name | camelCase}}ServiceProperties{}
|
||||||
|
logger.SetLevel(c.LogLevel)
|
||||||
return &{{$service.Name | camelCase}}Service{Config: c, Properties: properties}, nil
|
return &{{$service.Name | camelCase}}Service{Config: c, Properties: properties}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue