infra
/
goutils
Archived
1
0
Fork 0

패키지 꼬인것 고침

This commit is contained in:
Sangbum Kim 2018-06-10 16:57:59 +09:00
parent 2ca5d87b66
commit b1f49e40e7
5 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
package util package handler
import ( import (
"sync" "sync"

View File

@ -1,4 +1,4 @@
package util package image
import ( import (
"sync" "sync"

View File

@ -3,7 +3,7 @@ package logger
import "io" import "io"
type WriteSyncer interface { type WriteSyncer interface {
io.Writer io.WriteCloser
Sync() error Sync() error
} }

View File

@ -7,14 +7,14 @@ import (
"amuz.es/src/infra/goutils/logger" "amuz.es/src/infra/goutils/logger"
) )
var loggers logger.RotateSyncerSet var loggers RotateSyncerSet
func NewLogWriter(FileName string, MaxSizeMb, MaxBackup, MaxDay int, logDir string) logger.RotateSyncer { func NewLogWriter(FileName string, MaxSizeMb, MaxBackup, MaxDay int, logDir string) logger.RotateSyncer {
switch FileName { switch FileName {
case "Stdout": case "Stdout":
return newLocked(os.Stdout) return NewLocked(os.Stdout)
case "Stderr": case "Stderr":
return newLocked(os.Stderr) return NewLocked(os.Stderr)
default: default:
logpath := FileName logpath := FileName
if logDir != "" { if logDir != "" {
@ -23,7 +23,7 @@ func NewLogWriter(FileName string, MaxSizeMb, MaxBackup, MaxDay int, logDir stri
log.Println(" Attention!! log writes to ", logpath) log.Println(" Attention!! log writes to ", logpath)
logWriter := newRotater( logWriter := NewRotater(
logpath, logpath,
MaxSizeMb, // megabytes MaxSizeMb, // megabytes
MaxBackup, MaxBackup,

View File

@ -3,6 +3,7 @@ package rotater
import ( import (
"sync" "sync"
"amuz.es/src/infra/goutils/logger" "amuz.es/src/infra/goutils/logger"
lumberjack "gopkg.in/natefinch/lumberjack.v2"
) )
type rotateSyncer struct { type rotateSyncer struct {