* modify cns logging

* update to implement stringer interface

* fixing linting errors

* removing log metadata

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>

Co-authored-by: Camryn Lee <camrynlee@microsoft.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
This commit is contained in:
Camryn Lee 2022-05-12 11:31:00 -07:00 коммит произвёл GitHub
Родитель a8cf7a243a
Коммит 281eb70929
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -90,6 +90,16 @@ type CreateNetworkContainerRequest struct {
EndpointPolicies []NetworkContainerRequestPolicies
}
// CreateNetworkContainerRequest implements fmt.Stringer for logging
func (req *CreateNetworkContainerRequest) String() string {
return fmt.Sprintf("CreateNetworkContainerRequest"+
"{Version: %s, NetworkContainerType: %s, NetworkContainerid: %s, PrimaryInterfaceIdentifier: %s, "+
"LocalIPConfiguration: %+v, IPConfiguration: %+v, SecondaryIPConfigs: %+v, MultitenancyInfo: %+v, "+
"AllowHostToNCCommunication: %t, AllowNCToHostCommunication: %t}",
req.Version, req.NetworkContainerType, req.NetworkContainerid, req.PrimaryInterfaceIdentifier, req.LocalIPConfiguration,
req.IPConfiguration, req.SecondaryIPConfigs, req.MultiTenancyInfo, req.AllowHostToNCCommunication, req.AllowNCToHostCommunication)
}
// NetworkContainerRequestPolicies - specifies policies associated with create network request
type NetworkContainerRequestPolicies struct {
Type string

Просмотреть файл

@ -790,7 +790,7 @@ func (service *HTTPRestService) createOrUpdateNetworkContainer(w http.ResponseWr
var req cns.CreateNetworkContainerRequest
err := service.Listener.Decode(w, r, &req)
logger.Request(service.Name, &req, err)
logger.Request(service.Name, req.String(), err)
if err != nil {
return
}