for문 추가?

main
JungJun 2 years ago
parent 68ba2f89cb
commit f8e86f001f

@ -265,82 +265,83 @@ func StatsCommandVA(t *icsnet.IcsTCPNet, bufend string) {
defer t.Close()
statReads, rlen, rerr := t.ReadS(10137, bufend) // 여기서 전체 몇 byte씩 읽어서 로그를 찍을건지 알아야함
if rerr != nil {
if rerr.GetError() != io.EOF {
return
for {
statReads, rlen, rerr := t.ReadS(10137, bufend) // 여기서 전체 몇 byte씩 읽어서 로그를 찍을건지 알아야함
if rerr != nil {
if rerr.GetError() != io.EOF {
return
}
} else {
fmt.Printf("Recved Stat Command(%s) %d \n", statReads, rlen)
statInfos.ChangeByteToString(statReads)
svc := statInfos.SvcType[0:1]
seqId := s.Seq + svc + randNum
hostName := conf.InfoConfig.HostName
insLog := ""
insLog += fmt.Sprintf("SEQ_ID=%s|", seqId)
insLog += fmt.Sprintf("LOG_TIME=%s|", statInfos.LogTime)
insLog += fmt.Sprintf("LOG_TYPE=%s|", statInfos.LogType)
insLog += fmt.Sprintf("SID=%s|", statInfos.Sid)
insLog += fmt.Sprintf("RESULT_CODE=%s|", statInfos.ResultCode)
insLog += fmt.Sprintf("REQ_TIME=%s|", statInfos.ReqTime)
insLog += fmt.Sprintf("RSP_TIME=%s|", statInfos.RspTime)
insLog += fmt.Sprintf("CLIENT_IP=%s|", statInfos.ClientIp)
insLog += fmt.Sprintf("DEV_INFO=%s|", statInfos.DevInfo)
insLog += fmt.Sprintf("OS_INFO=%s|", statInfos.OsInfo)
insLog += fmt.Sprintf("NW_INFO=%s|", statInfos.NwInfo)
insLog += fmt.Sprintf("SVC_NAME=%s|", statInfos.SvcName)
insLog += fmt.Sprintf("DEV_MODEL=%s|", statInfos.DevModel)
insLog += fmt.Sprintf("CARRIER_TYPE=%s|", statInfos.CarrierType)
insLog += fmt.Sprintf("HOST_NAME=%s|", hostName)
insLog += fmt.Sprintf("SCN_NAME=%s|", statInfos.ScnName)
insLog += fmt.Sprintf("CALL_ID=%s|", statInfos.CallId)
insLog += fmt.Sprintf("TR_ID=%s|", statInfos.TrId)
insLog += fmt.Sprintf("CONC_CALL=%s|", statInfos.ConcCall)
insLog += fmt.Sprintf("SVC_TYPE=%s|", statInfos.SvcType)
insLog += fmt.Sprintf("SVC_REQ_TIME=%s|", statInfos.SvcReqTime)
insLog += fmt.Sprintf("SVC_RSP_TIME=%s|", statInfos.SvcRspTime)
insLog += fmt.Sprintf("TRANSFER_NO=%s|", statInfos.TransferNo)
insLog += fmt.Sprintf("CALL_TIME=%s|", statInfos.CallTime)
insLog += fmt.Sprintf("CALL_TYPE=%s|", statInfos.CallType)
insLog += fmt.Sprintf("FUN_NAME=%s|", statInfos.FunName)
insLog += fmt.Sprintf("RESULT_MSG=%s|", statInfos.ResultMsg)
insLog += fmt.Sprintf("STT_TEXT=%s|", statInfos.SttText)
insLog += fmt.Sprintf("TTS_TEXT=%s", statInfos.TtsText)
l.Printf(icslog.LOG_LEVEL_INFO, -1, "%s", insLog)
// fmt.Printf("stats- %s \n", statInfos.SeqId)
// fmt.Printf("stats- %s \n", statInfos.LogTime)
// fmt.Printf("stats- %s \n", statInfos.LogType)
// fmt.Printf("stats- %s \n", statInfos.Sid)
// fmt.Printf("stats- %s \n", statInfos.ResultCode)
// fmt.Printf("stats- %s \n", statInfos.ReqTime)
// fmt.Printf("stats- %s \n", statInfos.RspTime)
// fmt.Printf("stats- %s \n", statInfos.ClientIp)
// fmt.Printf("stats- %s \n", statInfos.DevInfo)
// fmt.Printf("stats- %s \n", statInfos.OsInfo)
// fmt.Printf("stats- %s \n", statInfos.NwInfo)
// fmt.Printf("stats- %s \n", statInfos.SvcName)
// fmt.Printf("stats- %s \n", statInfos.DevModel)
// fmt.Printf("stats- %s \n", statInfos.CarrierType)
// fmt.Printf("stats- %s \n", statInfos.HostName)
// fmt.Printf("stats- %s \n", statInfos.ScnName)
// fmt.Printf("stats- %s \n", statInfos.CallId)
// fmt.Printf("stats- %s \n", statInfos.TrId)
// fmt.Printf("stats- %s \n", statInfos.ConcCall)
// fmt.Printf("stats- %s \n", statInfos.SvcType)
// fmt.Printf("stats- %s \n", statInfos.SvcReqTime)
// fmt.Printf("stats- %s \n", statInfos.SvcRspTime)
// fmt.Printf("stats- %s \n", statInfos.TransferNo)
// fmt.Printf("stats- %s \n", statInfos.CallTime)
// fmt.Printf("stats- %s \n", statInfos.CallType)
// fmt.Printf("stats- %s \n", statInfos.FunName)
// fmt.Printf("stats- %s \n", statInfos.ResultMsg)
// fmt.Printf("stats- %s \n", statInfos.SttText)
// fmt.Printf("stats- %s \n", statInfos.TtsText)
}
} else {
fmt.Printf("Recved Stat Command(%s) %d \n", statReads, rlen)
statInfos.ChangeByteToString(statReads)
svc := statInfos.SvcType[0:1]
seqId := s.Seq + svc + randNum
hostName := conf.InfoConfig.HostName
insLog := ""
insLog += fmt.Sprintf("SEQ_ID=%s|", seqId)
insLog += fmt.Sprintf("LOG_TIME=%s|", statInfos.LogTime)
insLog += fmt.Sprintf("LOG_TYPE=%s|", statInfos.LogType)
insLog += fmt.Sprintf("SID=%s|", statInfos.Sid)
insLog += fmt.Sprintf("RESULT_CODE=%s|", statInfos.ResultCode)
insLog += fmt.Sprintf("REQ_TIME=%s|", statInfos.ReqTime)
insLog += fmt.Sprintf("RSP_TIME=%s|", statInfos.RspTime)
insLog += fmt.Sprintf("CLIENT_IP=%s|", statInfos.ClientIp)
insLog += fmt.Sprintf("DEV_INFO=%s|", statInfos.DevInfo)
insLog += fmt.Sprintf("OS_INFO=%s|", statInfos.OsInfo)
insLog += fmt.Sprintf("NW_INFO=%s|", statInfos.NwInfo)
insLog += fmt.Sprintf("SVC_NAME=%s|", statInfos.SvcName)
insLog += fmt.Sprintf("DEV_MODEL=%s|", statInfos.DevModel)
insLog += fmt.Sprintf("CARRIER_TYPE=%s|", statInfos.CarrierType)
insLog += fmt.Sprintf("HOST_NAME=%s|", hostName)
insLog += fmt.Sprintf("SCN_NAME=%s|", statInfos.ScnName)
insLog += fmt.Sprintf("CALL_ID=%s|", statInfos.CallId)
insLog += fmt.Sprintf("TR_ID=%s|", statInfos.TrId)
insLog += fmt.Sprintf("CONC_CALL=%s|", statInfos.ConcCall)
insLog += fmt.Sprintf("SVC_TYPE=%s|", statInfos.SvcType)
insLog += fmt.Sprintf("SVC_REQ_TIME=%s|", statInfos.SvcReqTime)
insLog += fmt.Sprintf("SVC_RSP_TIME=%s|", statInfos.SvcRspTime)
insLog += fmt.Sprintf("TRANSFER_NO=%s|", statInfos.TransferNo)
insLog += fmt.Sprintf("CALL_TIME=%s|", statInfos.CallTime)
insLog += fmt.Sprintf("CALL_TYPE=%s|", statInfos.CallType)
insLog += fmt.Sprintf("FUN_NAME=%s|", statInfos.FunName)
insLog += fmt.Sprintf("RESULT_MSG=%s|", statInfos.ResultMsg)
insLog += fmt.Sprintf("STT_TEXT=%s|", statInfos.SttText)
insLog += fmt.Sprintf("TTS_TEXT=%s", statInfos.TtsText)
l.Printf(icslog.LOG_LEVEL_INFO, -1, "%s", insLog)
// fmt.Printf("stats- %s \n", statInfos.SeqId)
// fmt.Printf("stats- %s \n", statInfos.LogTime)
// fmt.Printf("stats- %s \n", statInfos.LogType)
// fmt.Printf("stats- %s \n", statInfos.Sid)
// fmt.Printf("stats- %s \n", statInfos.ResultCode)
// fmt.Printf("stats- %s \n", statInfos.ReqTime)
// fmt.Printf("stats- %s \n", statInfos.RspTime)
// fmt.Printf("stats- %s \n", statInfos.ClientIp)
// fmt.Printf("stats- %s \n", statInfos.DevInfo)
// fmt.Printf("stats- %s \n", statInfos.OsInfo)
// fmt.Printf("stats- %s \n", statInfos.NwInfo)
// fmt.Printf("stats- %s \n", statInfos.SvcName)
// fmt.Printf("stats- %s \n", statInfos.DevModel)
// fmt.Printf("stats- %s \n", statInfos.CarrierType)
// fmt.Printf("stats- %s \n", statInfos.HostName)
// fmt.Printf("stats- %s \n", statInfos.ScnName)
// fmt.Printf("stats- %s \n", statInfos.CallId)
// fmt.Printf("stats- %s \n", statInfos.TrId)
// fmt.Printf("stats- %s \n", statInfos.ConcCall)
// fmt.Printf("stats- %s \n", statInfos.SvcType)
// fmt.Printf("stats- %s \n", statInfos.SvcReqTime)
// fmt.Printf("stats- %s \n", statInfos.SvcRspTime)
// fmt.Printf("stats- %s \n", statInfos.TransferNo)
// fmt.Printf("stats- %s \n", statInfos.CallTime)
// fmt.Printf("stats- %s \n", statInfos.CallType)
// fmt.Printf("stats- %s \n", statInfos.FunName)
// fmt.Printf("stats- %s \n", statInfos.ResultMsg)
// fmt.Printf("stats- %s \n", statInfos.SttText)
// fmt.Printf("stats- %s \n", statInfos.TtsText)
}
// }
}
func (statInfos *StatInfos) ChangeByteToString(statInfo []byte) *icserror.IcsError {

Loading…
Cancel
Save