|
|
@ -3,6 +3,7 @@ package logx
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"syscall"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
@ -97,7 +98,13 @@ func TestRotateLoggerRotate(t *testing.T) {
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err = logger.rotate()
|
|
|
|
err = logger.rotate()
|
|
|
|
assert.Nil(t, err)
|
|
|
|
switch v := err.(type) {
|
|
|
|
|
|
|
|
case *os.LinkError:
|
|
|
|
|
|
|
|
// avoid rename error on ubuntu
|
|
|
|
|
|
|
|
assert.Equal(t, syscall.EXDEV, v.Err)
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
assert.Nil(t, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestRotateLoggerWrite(t *testing.T) {
|
|
|
|
func TestRotateLoggerWrite(t *testing.T) {
|
|
|
|