@@ -133,6 +133,7 @@ function pad(value) {
133
133
const kNone = 1 << 0 ;
134
134
const kSkipLog = 1 << 1 ;
135
135
const kSkipTrace = 1 << 2 ;
136
+ const kShouldSkipAll = kSkipLog | kSkipTrace ;
136
137
137
138
const kSecond = 1000 ;
138
139
const kMinute = 60 * kSecond ;
@@ -377,8 +378,6 @@ function debugWithTimer(set, cb) {
377
378
let debugLogCategoryEnabled = false ;
378
379
let timerFlags = kNone ;
379
380
380
- const skipAll = kSkipLog | kSkipTrace ;
381
-
382
381
function ensureTimerFlagsAreUpdated ( ) {
383
382
timerFlags &= ~ kSkipTrace ;
384
383
@@ -393,7 +392,7 @@ function debugWithTimer(set, cb) {
393
392
function internalStartTimer ( logLabel , traceLabel ) {
394
393
ensureTimerFlagsAreUpdated ( ) ;
395
394
396
- if ( timerFlags === skipAll ) {
395
+ if ( ( timerFlags & kShouldSkipAll ) === kShouldSkipAll ) {
397
396
return ;
398
397
}
399
398
@@ -413,7 +412,7 @@ function debugWithTimer(set, cb) {
413
412
function internalEndTimer ( logLabel , traceLabel ) {
414
413
ensureTimerFlagsAreUpdated ( ) ;
415
414
416
- if ( timerFlags === skipAll ) {
415
+ if ( ( timerFlags & kShouldSkipAll ) === kShouldSkipAll ) {
417
416
return ;
418
417
}
419
418
@@ -434,7 +433,7 @@ function debugWithTimer(set, cb) {
434
433
function internalLogTimer ( logLabel , traceLabel , args ) {
435
434
ensureTimerFlagsAreUpdated ( ) ;
436
435
437
- if ( timerFlags === skipAll ) {
436
+ if ( ( timerFlags & kShouldSkipAll ) === kShouldSkipAll ) {
438
437
return ;
439
438
}
440
439
@@ -477,7 +476,7 @@ function debugWithTimer(set, cb) {
477
476
const startTimer = ( logLabel , traceLabel ) => {
478
477
init ( ) ;
479
478
480
- if ( timerFlags !== skipAll )
479
+ if ( ( timerFlags & kShouldSkipAll ) !== kShouldSkipAll )
481
480
internalStartTimer ( logLabel , traceLabel ) ;
482
481
} ;
483
482
@@ -487,7 +486,7 @@ function debugWithTimer(set, cb) {
487
486
const endTimer = ( logLabel , traceLabel ) => {
488
487
init ( ) ;
489
488
490
- if ( timerFlags !== skipAll )
489
+ if ( ( timerFlags & kShouldSkipAll ) !== kShouldSkipAll )
491
490
internalEndTimer ( logLabel , traceLabel ) ;
492
491
} ;
493
492
@@ -497,7 +496,7 @@ function debugWithTimer(set, cb) {
497
496
const logTimer = ( logLabel , traceLabel , args ) => {
498
497
init ( ) ;
499
498
500
- if ( timerFlags !== skipAll )
499
+ if ( ( timerFlags & kShouldSkipAll ) !== kShouldSkipAll )
501
500
internalLogTimer ( logLabel , traceLabel , args ) ;
502
501
} ;
503
502
0 commit comments