Skip to content

Commit

Permalink
remove checke log level
Browse files Browse the repository at this point in the history
  • Loading branch information
dogfootman committed Jul 3, 2024
1 parent 5051c06 commit ab9597f
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 198 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ func ConvertToString(value interface{}) (string, error) {

// Cloud Object를 CB-KeyValue 형식으로 변환이 필요할 경우 이용
func ConvertKeyValueList(v interface{}) ([]irs.KeyValue, error) {
if cblogger.Level.String() == "debug" {
cblogger.Debug(v)
}
cblogger.Debug(v)

var keyValueList []irs.KeyValue
var i map[string]interface{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,8 @@ func ExtractImageDescribeInfo(image *ecs.Image) irs.ImageInfo {
//@TODO : 2020-04-20 ecs.ImageInDescribeImages를 인식 못해서 다시 ecs.Image로 변경해 놓음.
//func ExtractImageDescribeInfo(image *ecs.Image) irs.ImageInfo {
//*ecs.DescribeImagesResponse
if cblogger.Level.String() == "debug" {
cblogger.Debug("=====> ")
cblogger.Debug(image)
//cblogger.Debug(image)
}
cblogger.Debug(image)

imageInfo := irs.ImageInfo{
IId: irs.IID{NameId: image.ImageId, SystemId: image.ImageId},
//Name: image.ImageName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ func (keyPairHandler *AlibabaKeyPairHandler) CreateKey(keyPairReqInfo irs.KeyPai
callogger.Info(call.String(callLogInfo))

cblogger.Infof("Created key pair %q %s\n%s\n", result.KeyPairName, result.KeyPairFingerPrint, result.PrivateKeyBody)
if cblogger.Level.String() == "debug" {
//cblogger.Debug(result)
cblogger.Debug(result)
}
cblogger.Debug(result)

/* 2021-10-27 이슈#480에 의해 Local Key 로직 제거
cblogger.Info("공개키 생성")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,7 @@ func (securityHandler *AlibabaSecurityHandler) AddRules(securityIID irs.IID, req
securityGroupId := securityIID.SystemId
cblogger.Infof("securityGroupId : [%s] / securityRuleInfos : [%v]", securityGroupId, reqSecurityRules)
//cblogger.Info("AuthorizeSecurityRules ", securityRuleInfos)
if cblogger.Level.String() == "debug" {
cblogger.Debug(reqSecurityRules)
//cblogger.Debug(reqSecurityRules)
}
cblogger.Debug(reqSecurityRules)

if len(*reqSecurityRules) < 1 {
return irs.SecurityInfo{}, errors.New("invalid value - The SecurityRules to add is empty")
Expand Down Expand Up @@ -188,10 +185,7 @@ func (securityHandler *AlibabaSecurityHandler) AddRules(securityIID irs.IID, req
request.DestCidrIp = curRule.CIDR

cblogger.Infof("[%s] [%s] outbound rule Request", request.IpProtocol, request.PortRange)
if cblogger.Level.String() == "debug" {
//cblogger.Debug(request)
cblogger.Debug(request)
}
cblogger.Debug(request)

response, err := securityHandler.Client.AuthorizeSecurityGroupEgress(request)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,7 @@ func (vmHandler *AlibabaVMHandler) ListVM() ([]*irs.VMInfo, error) {
return nil, errVmInfo
}
//cblogger.Info("=======>VM 조회 결과")
if cblogger.Level.String() == "debug" {
//cblogger.Debug(vmInfo)
cblogger.Debug(vmInfo)
}
cblogger.Debug(vmInfo)

vmInfoList = append(vmInfoList, &vmInfo)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ func (ClusterHandler *AwsClusterHandler) CreateCluster(clusterReqInfo irs.Cluste
}
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(input)
}
cblogger.Debug(input)

// logger for HisCall
callogger := call.GetLogger("HISCALL")
Expand Down Expand Up @@ -164,10 +162,8 @@ func (ClusterHandler *AwsClusterHandler) CreateCluster(clusterReqInfo irs.Cluste
if nodeGroupErr != nil {
cblogger.Error(err.Error())
}
if cblogger.Level.String() == "debug" {
cblogger.Debug(resultNodeGroupInfo)
}
}
cblogger.Debug(resultNodeGroupInfo)
//----- wait until Status=COMPLETE -----// : Nodegroup이 모두 생성되면 조회
*/

Expand Down Expand Up @@ -292,9 +288,7 @@ func (ClusterHandler *AwsClusterHandler) GetCluster(clusterIID irs.IID) (irs.Clu
Name: aws.String(clusterIID.SystemId),
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(input)
}
cblogger.Debug(input)

// logger for HisCall
callogger := call.GetLogger("HISCALL")
Expand Down Expand Up @@ -455,9 +449,7 @@ func (ClusterHandler *AwsClusterHandler) DeleteCluster(clusterIID irs.IID) (bool
Name: aws.String(clusterIID.SystemId),
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(input)
}
cblogger.Debug(input)

// logger for HisCall
callogger := call.GetLogger("HISCALL")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,8 @@ func DescribeVolumnes(svc *ec2.EC2, volumeIdList []*string) (*ec2.DescribeVolume
}
return nil, err
}
if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}

cblogger.Debug(result)

return result, nil
}
Expand Down Expand Up @@ -268,9 +267,7 @@ func DescribeVolumneById(svc *ec2.EC2, volumeId string) (*ec2.Volume, error) {
}
return nil, err
}
if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

for _, volume := range result.Volumes {
if strings.EqualFold(volumeId, *volume.VolumeId) {
Expand Down Expand Up @@ -312,9 +309,8 @@ func DescribeVolumnesBySnapshot(svc *ec2.EC2, snapShotIIDs []string) (*ec2.Descr

result, err := svc.DescribeVolumes(input)
callogger.Info("DescribeVolumnesBySnapshot IN PU T")
if cblogger.Level.String() == "debug" {
cblogger.Debug(input)
}
cblogger.Debug(input)

callLogInfo.ElapsedTime = call.Elapsed(callLogStart)
callogger.Info(call.String(callLogInfo))

Expand All @@ -329,9 +325,7 @@ func DescribeVolumnesBySnapshot(svc *ec2.EC2, snapShotIIDs []string) (*ec2.Descr
}
return nil, err
}
if cblogger.Level.String() == "debug" {
cblogger.Debug(result.Volumes)
}
cblogger.Debug(result.Volumes)

return result, nil
}
Expand Down Expand Up @@ -370,9 +364,7 @@ func AttachVolume(svc *ec2.EC2, deviceName string, instanceId string, volumeId s
return err
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

err = WaitUntilVolumeInUse(svc, volumeId)
if err != nil {
Expand Down Expand Up @@ -404,9 +396,7 @@ func DeleteDisk(svc *ec2.EC2, disks []irs.IID) (bool, error) {
return false, err
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

err = WaitUntilVolumeDeleted(svc, diskIID.SystemId)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ func (DiskHandler *AwsDiskHandler) DeleteDisk(diskIID irs.IID) (bool, error) {
}
calllogger.Info(call.String(hiscallInfo))

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

err = WaitUntilVolumeDeleted(DiskHandler.Client, diskIID.SystemId)
if err != nil {
Expand Down Expand Up @@ -404,9 +402,7 @@ func (DiskHandler *AwsDiskHandler) AttachDisk(diskIID irs.IID, ownerVM irs.IID)
}
calllogger.Info(call.String(hiscallInfo))

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

err = WaitUntilVolumeInUse(DiskHandler.Client, diskIID.SystemId)
if err != nil {
Expand Down Expand Up @@ -458,9 +454,7 @@ func (DiskHandler *AwsDiskHandler) DetachDisk(diskIID irs.IID, ownerVM irs.IID)
}
calllogger.Info(call.String(hiscallInfo))

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

err = WaitUntilVolumeInUse(DiskHandler.Client, diskIID.SystemId)
if err != nil {
Expand Down Expand Up @@ -904,8 +898,7 @@ func (DiskHandler *AwsDiskHandler) convertVolumeInfoToDiskInfo(volumeInfo *ec2.V
//inKeyValueList = append(inKeyValueList, icbs.KeyValue{Key: "OutpostArn", Value: *volumeInfo.OutpostArn})
diskInfo.KeyValueList = inKeyValueList
cblogger.Debug("keyvalue2")
if cblogger.Level.String() == "debug" {
cblogger.Debug(diskInfo)
}
cblogger.Debug(diskInfo)

return diskInfo, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ func (ImageHandler *AwsMyImageHandler) SnapshotVM(snapshotReqInfo irs.MyImageInf
TagSpecifications: tagSpecs,
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(input)
}
cblogger.Debug(input)

result, err := ImageHandler.Client.CreateImage(input)
hiscallInfo.ElapsedTime = call.Elapsed(start)
Expand Down Expand Up @@ -357,9 +355,7 @@ func (ImageHandler *AwsMyImageHandler) ListMyImage() ([]*irs.MyImageInfo, error)
}
calllogger.Info(call.String(hiscallInfo))

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)
for _, awsImage := range result.Images {
myImage, err := convertAWSImageToMyImageInfo(awsImage)
if err != nil {
Expand Down Expand Up @@ -416,9 +412,7 @@ func (ImageHandler *AwsMyImageHandler) DeleteMyImage(myImageIID irs.IID) (bool,
cblogger.Error(err)
return false, err
}
if cblogger.Level.String() == "debug" {
cblogger.Debug(diskIIDs)
}
cblogger.Debug(diskIIDs)

input := &ec2.DeregisterImageInput{}
input.ImageId = aws.String(myImageIID.SystemId)
Expand All @@ -432,9 +426,7 @@ func (ImageHandler *AwsMyImageHandler) DeleteMyImage(myImageIID irs.IID) (bool,
}
calllogger.Info(call.String(hiscallInfo))

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

for _, snapshotId := range snapshotIds {
snapShotDeleteResult, err := ImageHandler.DeleteSnapshotById(snapshotId)
Expand Down Expand Up @@ -566,9 +558,7 @@ func (MyImageHandler *AwsMyImageHandler) DeleteSnapshotById(snapshotId string) (
return false, err
}

if cblogger.Level.String() == "debug" {
cblogger.Debug(result)
}
cblogger.Debug(result)

return true, nil
}
Expand Down
Loading

0 comments on commit ab9597f

Please sign in to comment.