File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2135,7 +2135,11 @@ Raven.prototype = {
2135
2135
} ,
2136
2136
2137
2137
_logDebug : function ( level ) {
2138
- if ( this . _originalConsoleMethods [ level ] && this . debug ) {
2138
+ // We allow `Raven.debug` and `Raven.config(DSN, { debug: true })` to not make backward incompatible API change
2139
+ if (
2140
+ this . _originalConsoleMethods [ level ] &&
2141
+ ( this . debug || this . _globalOptions . debug )
2142
+ ) {
2139
2143
// In IE<10 console methods do not have their own 'apply' method
2140
2144
Function . prototype . apply . call (
2141
2145
this . _originalConsoleMethods [ level ] ,
Original file line number Diff line number Diff line change @@ -262,6 +262,13 @@ describe('globals', function() {
262
262
assert . isTrue ( originalConsoleMethods [ level ] . calledOnce ) ;
263
263
} ) ;
264
264
265
+ it ( 'should write to console when Raven.config(DSN, { debug: true })' , function ( ) {
266
+ Raven . _globalOptions . debug = true ;
267
+ this . sinon . stub ( originalConsoleMethods , level ) ;
268
+ Raven . _logDebug ( level , message ) ;
269
+ assert . isTrue ( originalConsoleMethods [ level ] . calledOnce ) ;
270
+ } ) ;
271
+
265
272
it ( 'should handle variadic arguments' , function ( ) {
266
273
Raven . debug = true ;
267
274
this . sinon . stub ( originalConsoleMethods , level ) ;
You can’t perform that action at this time.
0 commit comments