File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed
Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -9,24 +9,19 @@ function logMessage(
99 err ?: Error ,
1010 notification ?: Notification ,
1111) {
12- if ( notification && err ) {
13- logFunction (
14- `[${ type } ]:` ,
15- message ,
16- `[${ notification . subject . type } ]: ${ notification . subject . title } for repository ${ notification . repository . full_name } ` ,
17- err ,
18- ) ;
19- } else if ( notification ) {
20- logFunction (
21- `[${ type } ]:` ,
22- message ,
12+ const args : ( string | Error ) [ ] = [ `[${ type } ]:` , message ] ;
13+
14+ if ( notification ) {
15+ args . push (
2316 `[${ notification . subject . type } ]: ${ notification . subject . title } for repository ${ notification . repository . full_name } ` ,
2417 ) ;
25- } else if ( err ) {
26- logFunction ( `[${ type } ]:` , message , err ) ;
27- } else {
28- logFunction ( `[${ type } ]:` , message ) ;
2918 }
19+
20+ if ( err ) {
21+ args . push ( err ) ;
22+ }
23+
24+ logFunction ( ...args ) ;
3025}
3126
3227export function logInfo (
You can’t perform that action at this time.
0 commit comments