projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4792703
)
Incorporate Paul's stack trace logging fix.
author
Dan Vanderkam
<dan@dygraphs.com>
Wed, 21 Dec 2011 19:28:52 +0000
(14:28 -0500)
committer
Dan Vanderkam
<dan@dygraphs.com>
Wed, 21 Dec 2011 19:28:52 +0000
(14:28 -0500)
dygraph-utils.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph-utils.js
b/dygraph-utils.js
index
a391190
..
82d9189
100644
(file)
--- a/
dygraph-utils.js
+++ b/
dygraph-utils.js
@@
-44,16
+44,18
@@
Dygraph.log = function(severity, message) {
if (typeof(printStackTrace) != 'undefined') {
// Remove uninteresting bits: logging functions and paths.
var st = printStackTrace({guess:false});
if (typeof(printStackTrace) != 'undefined') {
// Remove uninteresting bits: logging functions and paths.
var st = printStackTrace({guess:false});
- while (st[0].indexOf("
Function.log") != 0
) {
+ while (st[0].indexOf("
stacktrace") != -1
) {
st.splice(0, 1);
}
st.splice(0, 1);
}
+
st.splice(0, 2);
for (var i = 0; i < st.length; i++) {
st.splice(0, 2);
for (var i = 0; i < st.length; i++) {
- st[i] = st[i].replace(/\([^)]*\/(.*)\)/, '
($1)
')
+ st[i] = st[i].replace(/\([^)]*\/(.*)\)/, '
@$1
')
.replace(/\@.*\/([^\/]*)/, '@$1')
.replace('[object Object].', '');
}
.replace(/\@.*\/([^\/]*)/, '@$1')
.replace('[object Object].', '');
}
- message += ' (' + st.splice(0, 1) + ')';
+ var top_msg = st.splice(0, 1)[0];
+ message += ' (' + top_msg.replace(/^.*@ ?/, '') + ')';
}
if (typeof(console) != 'undefined') {
}
if (typeof(console) != 'undefined') {