Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
bcac4bb8
Commit
bcac4bb8
authored
Jan 25, 2016
by
youngsterxyf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accept @JessonChan suggestion
parent
0e17e2a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
8 deletions
+3
-8
conn.go
logs/conn.go
+1
-2
console.go
logs/console.go
+1
-4
file.go
logs/file.go
+1
-2
No files found.
logs/conn.go
View file @
bcac4bb8
...
@@ -64,8 +64,7 @@ func (c *connWriter) WriteMsg(when time.Time, msg string, level int) error {
...
@@ -64,8 +64,7 @@ func (c *connWriter) WriteMsg(when time.Time, msg string, level int) error {
defer
c
.
innerWriter
.
Close
()
defer
c
.
innerWriter
.
Close
()
}
}
logTimeStr
:=
formatLogTime
(
when
)
msg
=
formatLogTime
(
when
)
+
msg
msg
=
logTimeStr
+
msg
c
.
lg
.
Println
(
msg
)
c
.
lg
.
Println
(
msg
)
return
nil
return
nil
...
...
logs/console.go
View file @
bcac4bb8
...
@@ -74,10 +74,7 @@ func (c *consoleWriter) WriteMsg(when time.Time, msg string, level int) error {
...
@@ -74,10 +74,7 @@ func (c *consoleWriter) WriteMsg(when time.Time, msg string, level int) error {
if
level
>
c
.
Level
{
if
level
>
c
.
Level
{
return
nil
return
nil
}
}
msg
=
formatLogTime
(
when
)
+
msg
logTimeStr
:=
formatLogTime
(
when
)
msg
=
logTimeStr
+
msg
if
goos
:=
runtime
.
GOOS
;
goos
==
"windows"
{
if
goos
:=
runtime
.
GOOS
;
goos
==
"windows"
{
c
.
lg
.
Println
(
msg
)
c
.
lg
.
Println
(
msg
)
return
nil
return
nil
...
...
logs/file.go
View file @
bcac4bb8
...
@@ -121,8 +121,7 @@ func (w *fileLogWriter) WriteMsg(when time.Time, msg string, level int) error {
...
@@ -121,8 +121,7 @@ func (w *fileLogWriter) WriteMsg(when time.Time, msg string, level int) error {
//2016/01/12 21:34:33
//2016/01/12 21:34:33
// now := time.Now()
// now := time.Now()
d
:=
when
.
Day
()
d
:=
when
.
Day
()
logTimeStr
:=
formatLogTime
(
when
)
msg
=
formatLogTime
(
when
)
+
msg
+
"
\n
"
msg
=
logTimeStr
+
msg
+
"
\n
"
if
w
.
Rotate
{
if
w
.
Rotate
{
if
w
.
needRotate
(
len
(
msg
),
d
)
{
if
w
.
needRotate
(
len
(
msg
),
d
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment