mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:10:56 +00:00
Merge branch 'master' of https://github.com/jialijelly/beego
This commit is contained in:
commit
547fbce86c
@ -278,10 +278,9 @@ func (w *fileLogWriter) doRotate(logTime time.Time) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
goto RESTART_LOGGER
|
goto RESTART_LOGGER
|
||||||
}
|
}
|
||||||
//err = os.Chmod(fName, os.FileMode(0444))
|
|
||||||
|
|
||||||
err = os.Chmod(fName, os.FileMode(otherPerm))
|
err = os.Chmod(fName, os.FileMode(otherPerm))
|
||||||
// re-start logger
|
|
||||||
RESTART_LOGGER:
|
RESTART_LOGGER:
|
||||||
|
|
||||||
startLoggerErr := w.startLogger()
|
startLoggerErr := w.startLogger()
|
||||||
|
@ -175,7 +175,7 @@ func TestFileRotate_06(t *testing.T) { //test file mode
|
|||||||
log.Emergency("emergency")
|
log.Emergency("emergency")
|
||||||
rotateName := "test3" + fmt.Sprintf(".%s.%03d", time.Now().Format("2006-01-02"), 1) + ".log"
|
rotateName := "test3" + fmt.Sprintf(".%s.%03d", time.Now().Format("2006-01-02"), 1) + ".log"
|
||||||
s, _ := os.Lstat(rotateName)
|
s, _ := os.Lstat(rotateName)
|
||||||
if s.Mode() != 0440 {
|
if s.Mode() != 0444 {
|
||||||
os.Remove(rotateName)
|
os.Remove(rotateName)
|
||||||
os.Remove("test3.log")
|
os.Remove("test3.log")
|
||||||
t.Fatal("rotate file mode error")
|
t.Fatal("rotate file mode error")
|
||||||
|
Loading…
Reference in New Issue
Block a user