diff --git a/service/qingcloud.go b/service/qingcloud.go index 68c57ae..9507be7 100644 --- a/service/qingcloud.go +++ b/service/qingcloud.go @@ -19,6 +19,7 @@ package service import ( "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/data" ) @@ -34,7 +35,7 @@ type QingCloudServiceProperties struct { func Init(c *config.Config) (*QingCloudService, error) { properties := &QingCloudServiceProperties{} - + logger.SetLevel(c.LogLevel) return &QingCloudService{Config: c, Properties: properties}, nil } diff --git a/template/service.tmpl b/template/service.tmpl index 95bf802..36ceb1c 100644 --- a/template/service.tmpl +++ b/template/service.tmpl @@ -23,6 +23,7 @@ import ( "github.com/yunify/qingcloud-sdk-go/config" "github.com/yunify/qingcloud-sdk-go/request" "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}} @@ -37,7 +38,7 @@ type {{$service.Name | camelCase}}ServiceProperties struct { func Init(c *config.Config) (*{{$service.Name | camelCase}}Service, error) { properties := &{{$service.Name | camelCase}}ServiceProperties{} - + logger.SetLevel(c.LogLevel) return &{{$service.Name | camelCase}}Service{Config: c, Properties: properties}, nil }