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
364cacf6
Commit
364cacf6
authored
Jun 08, 2015
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
record the critical logs in Prod
parent
21586586
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
20 deletions
+1
-20
router.go
router.go
+1
-20
No files found.
router.go
View file @
364cacf6
...
@@ -857,7 +857,6 @@ func (p *ControllerRegistor) recoverPanic(context *beecontext.Context) {
...
@@ -857,7 +857,6 @@ func (p *ControllerRegistor) recoverPanic(context *beecontext.Context) {
if
err
==
USERSTOPRUN
{
if
err
==
USERSTOPRUN
{
return
return
}
}
if
RunMode
==
"dev"
{
if
!
RecoverPanic
{
if
!
RecoverPanic
{
panic
(
err
)
panic
(
err
)
}
else
{
}
else
{
...
@@ -878,27 +877,9 @@ func (p *ControllerRegistor) recoverPanic(context *beecontext.Context) {
...
@@ -878,27 +877,9 @@ func (p *ControllerRegistor) recoverPanic(context *beecontext.Context) {
Critical
(
fmt
.
Sprintf
(
"%s:%d"
,
file
,
line
))
Critical
(
fmt
.
Sprintf
(
"%s:%d"
,
file
,
line
))
stack
=
stack
+
fmt
.
Sprintln
(
fmt
.
Sprintf
(
"%s:%d"
,
file
,
line
))
stack
=
stack
+
fmt
.
Sprintln
(
fmt
.
Sprintf
(
"%s:%d"
,
file
,
line
))
}
}
if
RunMode
==
"dev"
{
showErr
(
err
,
context
,
stack
)
showErr
(
err
,
context
,
stack
)
}
}
}
else
{
if
!
RecoverPanic
{
panic
(
err
)
}
else
{
// in production model show all infomation
if
ErrorsShow
{
exception
(
fmt
.
Sprint
(
err
),
context
)
}
else
{
Critical
(
"the request url is "
,
context
.
Input
.
Url
())
Critical
(
"Handler crashed with error"
,
err
)
for
i
:=
1
;
;
i
++
{
_
,
file
,
line
,
ok
:=
runtime
.
Caller
(
i
)
if
!
ok
{
break
}
Critical
(
fmt
.
Sprintf
(
"%s:%d"
,
file
,
line
))
}
}
}
}
}
}
}
}
}
...
...
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