mkdir 로그 추가

main
JungJun 2 years ago
parent 6e4c9be461
commit cede86e178

@ -145,12 +145,14 @@ func NewIcsLog(conf *icsconf.LogConfig, level int, output int, path string, disk
var oerr error var oerr error
oerr = os.MkdirAll(filepath.Dir(gIcsLog.LogFileName), 0777) oerr = os.MkdirAll(filepath.Dir(gIcsLog.LogFileName), 0777)
if oerr != nil { if oerr != nil {
fmt.Println("mkdir err : ", oerr)
icserror.ICSERRMakeDir.SetError(oerr) icserror.ICSERRMakeDir.SetError(oerr)
icserror.ICSERRMakeDir.PrintWithCaller(0) icserror.ICSERRMakeDir.PrintWithCaller(0)
return return
} }
fmt.Println("mkdir success")
gIcsLog.LogFile, oerr = os.OpenFile(gIcsLog.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) gIcsLog.LogFile, oerr = os.OpenFile(gIcsLog.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0777)
if oerr != nil { if oerr != nil {
//fmt.Println(gIcsLog.LogFileName) //fmt.Println(gIcsLog.LogFileName)
icserror.ICSERRFileOpen.SetError(oerr) icserror.ICSERRFileOpen.SetError(oerr)
@ -168,7 +170,7 @@ func NewIcsLog(conf *icsconf.LogConfig, level int, output int, path string, disk
return return
} }
gIcsLog.LogFile, oerr = os.OpenFile(gIcsLog.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) gIcsLog.LogFile, oerr = os.OpenFile(gIcsLog.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0777)
if oerr != nil { if oerr != nil {
//fmt.Println(gIcsLog.LogFileName) //fmt.Println(gIcsLog.LogFileName)
icserror.ICSERRFileOpen.SetError(oerr) icserror.ICSERRFileOpen.SetError(oerr)
@ -186,7 +188,7 @@ func NewIcsLog(conf *icsconf.LogConfig, level int, output int, path string, disk
return return
} }
gIcsLog.LogFile, oerr = os.OpenFile(gIcsLog.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) gIcsLog.LogFile, oerr = os.OpenFile(gIcsLog.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0777)
if oerr != nil { if oerr != nil {
//fmt.Println(gIcsLog.LogFileName) //fmt.Println(gIcsLog.LogFileName)
icserror.ICSERRFileOpen.SetError(oerr) icserror.ICSERRFileOpen.SetError(oerr)

Loading…
Cancel
Save