로그 제거

main
JungJun 2 years ago
parent 8cef94d4c6
commit dc1493d355

@ -5,7 +5,6 @@ import (
"gitlab.com/ics_cinnamon/voiceStatistics/icsconf"
"gitlab.com/ics_cinnamon/voiceStatistics/icserror"
"gitlab.com/ics_cinnamon/voiceStatistics/icslog"
"gitlab.com/ics_cinnamon/voiceStatistics/icsnet"
"gitlab.com/ics_cinnamon/voiceStatistics/icsstat"
"gitlab.com/ics_cinnamon/voiceStatistics/icssvc"
@ -33,7 +32,7 @@ func Init(conf *icsconf.IcsConfig) (e *IcsExec) {
}
func (exe IcsExec) Execute() *icserror.IcsError {
l := icslog.GetIcsLog()
// l := icslog.GetIcsLog()
icsstat.NewSidVal()
for !exe.service.GetExit() {
@ -73,13 +72,13 @@ func (exe IcsExec) Execute() *icserror.IcsError {
select {
case err := <-cmdDone:
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Gateway Stat TCP Connection: %s", err)
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Gateway Stat TCP Connection: %s", err)
if err != nil {
//err.Print()
return err
}
case err1 := <-cmdDone1:
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Agent Stat TCP Connection: %s", err1)
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Closed Agent Stat TCP Connection: %s", err1)
if err1 != nil {
//err.Print()
return err1

@ -1,8 +1,9 @@
package icsevent
import (
"fmt"
"gitlab.com/ics_cinnamon/voiceStatistics/icserror"
"gitlab.com/ics_cinnamon/voiceStatistics/icslog"
)
////////////////////////////////////////////////////////////////////
@ -71,7 +72,7 @@ func GetLength(first *RRData) (int, *icserror.IcsError) {
return -1, icserror.ICSERRInvalidParam
}
l := icslog.GetIcsLog()
// l := icslog.GetIcsLog()
var iter int = 0
for tmp := first; tmp != nil && tmp.tail != nil; tmp = tmp.tail {
var id int
@ -81,7 +82,8 @@ func GetLength(first *RRData) (int, *icserror.IcsError) {
id = v
}
p := h.getEvt(id)
l.Printf(icslog.LOG_LEVEL_DEBUG2, -1, "GetLength(%d)>%d-%v tmp>%p-%p", iter, id, p, tmp, tmp.tail)
fmt.Printf("GetLength(%d)>%d-%v tmp>%p-%p", iter, id, p, tmp, tmp.tail)
// l.Printf(icslog.LOG_LEVEL_DEBUG2, -1, "GetLength(%d)>%d-%v tmp>%p-%p", iter, id, p, tmp, tmp.tail)
iter++
}

@ -7,7 +7,6 @@ import (
"gitlab.com/ics_cinnamon/voiceStatistics/icsconf"
"gitlab.com/ics_cinnamon/voiceStatistics/icserror"
"gitlab.com/ics_cinnamon/voiceStatistics/icslog"
)
const (
@ -242,10 +241,10 @@ func ListenAndServeTCP(laddr, raddr *IcsNetAddr, bufend string, f func(*IcsTCPNe
}
//defer t.listener.Close()
l := icslog.GetIcsLog()
// l := icslog.GetIcsLog()
go func() {
//fmt.Printf("Started TCP Listen - %s\n", laddr.String())
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Started TCP Listen - %s", laddr.String())
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Started TCP Listen - %s", laddr.String())
for {
var conn *net.TCPConn
@ -259,7 +258,7 @@ func ListenAndServeTCP(laddr, raddr *IcsNetAddr, bufend string, f func(*IcsTCPNe
// newT.SetLinger(1)
newT.SetLinger()
newT.SetDeadline(180)
l.Printf(icslog.LOG_LEVEL_DEBUG, -1, "Connected - [%s][%s]", conn.LocalAddr(), conn.RemoteAddr())
// l.Printf(icslog.LOG_LEVEL_DEBUG, -1, "Connected - [%s][%s]", conn.LocalAddr(), conn.RemoteAddr())
//go f(conn, bufend)
go f(newT, bufend)
}

@ -92,7 +92,7 @@ const (
)
func ListenStatMNG() (icserr *icserror.IcsError) {
l := icslog.GetIcsLog()
// l := icslog.GetIcsLog()
conf := icsconf.GetIcsConfig()
//start bot-command listen
@ -104,17 +104,18 @@ func ListenStatMNG() (icserr *icserror.IcsError) {
var cmdErr *icserror.IcsError
statTCP, cmdErr := icsnet.ListenAndServeTCP(&statLocalAddr, nil, "\r\n", StatsCommandVG)
if cmdErr != nil {
l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
// l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
return nil
}
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
fmt.Printf("Listening Stat TCP Command %s port[%d]", statTransport, statPort)
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
fmt.Println(statTCP)
return nil
}
func ListenStatMNG1() (icserr *icserror.IcsError) {
l := icslog.GetIcsLog()
// l := icslog.GetIcsLog()
conf := icsconf.GetIcsConfig()
//start bot-command listen
@ -126,10 +127,11 @@ func ListenStatMNG1() (icserr *icserror.IcsError) {
var cmdErr *icserror.IcsError
statTCP, cmdErr := icsnet.ListenAndServeTCP(&statLocalAddr, nil, "\r\n", StatsCommandVA)
if cmdErr != nil {
l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
// l.Printf(icslog.LOG_LEVEL_FATAL, -1, "%s", cmdErr.GetError())
return nil
}
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
fmt.Printf("Listening Stat TCP Command %s port[%d]", statTransport, statPort)
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Listening Stat TCP Command %s port[%d]", statTransport, statPort)
fmt.Println(statTCP)
return nil
@ -169,14 +171,14 @@ func StatsCommandVG(t *icsnet.IcsTCPNet, bufend string) {
defer t.Close()
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
// for {
statReads, rlen, rerr := t.ReadS(10137, bufend) // 여기서 전체 몇 byte씩 읽어서 로그를 찍을건지 알아야함
if rerr != nil {
if rerr.GetError() != io.EOF {
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
rerr.GetError(), rlen, len(statReads))
// l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
// rerr.GetError(), rlen, len(statReads))
return
}
} else {
@ -271,14 +273,14 @@ func StatsCommandVA(t *icsnet.IcsTCPNet, bufend string) {
defer t.Close()
l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
// l.Printf(icslog.LOG_LEVEL_INFO, -1, "Connected from - %s", t.RemoteAddr())
// for {
statReads, rlen, rerr := t.ReadS(10137, bufend) // 여기서 전체 몇 byte씩 읽어서 로그를 찍을건지 알아야함
if rerr != nil {
if rerr.GetError() != io.EOF {
l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
rerr.GetError(), rlen, len(statReads))
// l.Printf(icslog.LOG_LEVEL_ERROR, -1, "[Stat Command] ReadS Error! - %s[%d:%d]",
// rerr.GetError(), rlen, len(statReads))
return
}
} else {

Loading…
Cancel
Save