패키지 꼬인것 고침
This commit is contained in:
parent
2ca5d87b66
commit
b1f49e40e7
|
@ -1,4 +1,4 @@
|
||||||
package util
|
package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package util
|
package image
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
|
@ -3,7 +3,7 @@ package logger
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
type WriteSyncer interface {
|
type WriteSyncer interface {
|
||||||
io.Writer
|
io.WriteCloser
|
||||||
Sync() error
|
Sync() error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Reference in New Issue