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 = {
21352135 } ,
21362136
21372137 _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+ ) {
21392143 // In IE<10 console methods do not have their own 'apply' method
21402144 Function . prototype . apply . call (
21412145 this . _originalConsoleMethods [ level ] ,
Original file line number Diff line number Diff line change @@ -262,6 +262,13 @@ describe('globals', function() {
262262 assert . isTrue ( originalConsoleMethods [ level ] . calledOnce ) ;
263263 } ) ;
264264
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+
265272 it ( 'should handle variadic arguments' , function ( ) {
266273 Raven . debug = true ;
267274 this . sinon . stub ( originalConsoleMethods , level ) ;
You can’t perform that action at this time.
0 commit comments