Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-enote-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enote
dtu-enote-core
Commits
1254b966
Commit
1254b966
authored
8 years ago
by
Iain Bryson
Browse files
Options
Downloads
Patches
Plain Diff
Keep a list of log lines. Send javascript errors up to the server.
parent
adfdce08
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/assets/javascripts/dtu_core/client_debug.js
+1
-1
1 addition, 1 deletion
app/assets/javascripts/dtu_core/client_debug.js
app/assets/javascripts/dtu_core/report_a_bug.coffee
+24
-1
24 additions, 1 deletion
app/assets/javascripts/dtu_core/report_a_bug.coffee
with
25 additions
and
2 deletions
app/assets/javascripts/dtu_core/client_debug.js
+
1
−
1
View file @
1254b966
...
...
@@ -10,7 +10,7 @@ var ClientDebug = {
var
packet
=
{
level
:
level
,
message
:
message
}
}
;
$
.
ajax
({
method
:
"
PUT
"
,
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/dtu_core/report_a_bug.coffee
+
24
−
1
View file @
1254b966
window
.
ConsoleBuffer
=
{
current_row
:
0
rows
:
new
Array
(
500
)
log
:
(
message
)
->
window
.
ConsoleBuffer
.
rows
[
window
.
ConsoleBuffer
.
current_row
]
=
message
window
.
ConsoleBuffer
.
current_row
=
window
.
ConsoleBuffer
.
current_row
%
window
.
ConsoleBuffer
.
rows
.
length
nonNilRows
:
()
->
return
window
.
ConsoleBuffer
.
rows
.
filter
(
x
)
->
return
x
}
window
.
reportABug
=
(
ev
)
->
console
.
log
(
"Report a Bug"
)
ClientDebug
.
send
(
'info'
,
{
msg
:
"Report a bug triggered "
,
location
:
window
.
location
}
)
ClientDebug
.
send
(
'error'
,
{
type
:
'user-generated'
,
msg
:
"Report a bug triggered "
,
location
:
window
.
location
.
href
,
logs
:
window
.
ConsoleBuffer
.
nonNilRows
()
}
)
window
.
onerror
=
(
msg
,
url
,
lineNo
,
columnNo
,
error
)
->
ClientDebug
.
send
(
'error'
,
{
type
:
'window.onerror'
,
url
:
url
,
lineNo
:
lineNo
,
columnNo
:
columnNo
,
message
:
msg
,
error
:
error
,
location
:
document
.
location
.
href
,
logs
:
window
.
ConsoleBuffer
.
nonNilRows
()
}
)
return
false
do
->
kinds
=
[
'log'
,
'warn'
,
'error'
,
'info'
]
for
kind
in
kinds
oldLog
=
console
[
kind
]
if
typeof
oldLog
is
'function'
console
[
kind
]
=
(
message
)
->
ConsoleBuffer
.
log
({
kind
:
kind
,
message
:
message
})
oldLog
.
apply
(
console
,
arguments
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment