File tree 2 files changed +18
-34
lines changed
firestore-bigquery-export
firestore-bigquery-change-tracker/src
2 files changed +18
-34
lines changed Original file line number Diff line number Diff line change @@ -49,36 +49,28 @@ export class Logger {
49
49
}
50
50
51
51
debug ( ...args : any [ ] ) : void {
52
- if ( this . logLevel <= levels . debug ) {
53
- funcsLogger . debug ( ...args ) ;
54
- }
52
+ this . runIfLogLevel ( levels . debug , funcsLogger . debug , ...args ) ;
55
53
}
56
54
57
55
log ( ...args : any [ ] ) : void {
58
56
this . info ( ...args ) ;
59
57
}
60
58
61
59
info ( ...args : any [ ] ) : void {
62
- if (
63
- this . logLevel <= levels . info
64
- ) {
65
- funcsLogger . info ( ...args ) ;
66
- }
60
+ this . runIfLogLevel ( levels . info , funcsLogger . info , ...args ) ;
67
61
}
68
62
69
63
warn ( ...args : any [ ] ) : void {
70
- if (
71
- this . logLevel <= levels . warn
72
- ) {
73
- funcsLogger . warn ( ...args ) ;
74
- }
64
+ this . runIfLogLevel ( levels . warn , funcsLogger . warn , ...args ) ;
75
65
}
76
66
77
67
error ( ...args : any [ ] ) : void {
78
- if (
79
- this . logLevel <= levels . error
80
- ) {
81
- funcsLogger . error ( ...args ) ;
68
+ this . runIfLogLevel ( levels . error , funcsLogger . error , ...args ) ;
69
+ }
70
+
71
+ private runIfLogLevel ( level : number , func : Function , ...args : any [ ] ) : void {
72
+ if ( this . logLevel <= level ) {
73
+ func ( ...args ) ;
82
74
}
83
75
}
84
76
}
Original file line number Diff line number Diff line change @@ -49,36 +49,28 @@ export class Logger {
49
49
}
50
50
51
51
debug ( ...args : any [ ] ) : void {
52
- if ( this . logLevel <= levels . debug ) {
53
- funcsLogger . debug ( ...args ) ;
54
- }
52
+ this . runIfLogLevel ( levels . debug , funcsLogger . debug , ...args ) ;
55
53
}
56
54
57
55
log ( ...args : any [ ] ) : void {
58
56
this . info ( ...args ) ;
59
57
}
60
58
61
59
info ( ...args : any [ ] ) : void {
62
- if (
63
- this . logLevel <= levels . info
64
- ) {
65
- funcsLogger . info ( ...args ) ;
66
- }
60
+ this . runIfLogLevel ( levels . info , funcsLogger . info , ...args ) ;
67
61
}
68
62
69
63
warn ( ...args : any [ ] ) : void {
70
- if (
71
- this . logLevel <= levels . warn
72
- ) {
73
- funcsLogger . warn ( ...args ) ;
74
- }
64
+ this . runIfLogLevel ( levels . warn , funcsLogger . warn , ...args ) ;
75
65
}
76
66
77
67
error ( ...args : any [ ] ) : void {
78
- if (
79
- this . logLevel <= levels . error
80
- ) {
81
- funcsLogger . error ( ...args ) ;
68
+ this . runIfLogLevel ( levels . error , funcsLogger . error , ...args ) ;
69
+ }
70
+
71
+ private runIfLogLevel ( level : number , func : Function , ...args : any [ ] ) : void {
72
+ if ( this . logLevel <= level ) {
73
+ func ( ...args ) ;
82
74
}
83
75
}
84
76
}
You can’t perform that action at this time.
0 commit comments