Fix CNS logging (#1372)
* 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:
Родитель
a8cf7a243a
Коммит
281eb70929
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче