File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ describe('github', () => {
2525
2626 strictEqual ( process . stdout . write . mock . callCount ( ) , 1 ) ;
2727 deepStrictEqual ( callsArgs , [
28- '::notice ::[21:00:00.000] \x1B[34mDEBUG\x1B[39m: Test message\n' ,
28+ '::debug ::[21:00:00.000] \x1B[34mDEBUG\x1B[39m: Test message\n' ,
2929 ] ) ;
3030 } ) ;
3131
@@ -72,7 +72,7 @@ describe('github', () => {
7272
7373 strictEqual ( process . stdout . write . mock . callCount ( ) , 1 ) ;
7474 deepStrictEqual ( callsArgs , [
75- '::notice ::[21:00:00.000] \x1B[35mERROR\x1B[39m: Test message\n' ,
75+ '::error ::[21:00:00.000] \x1B[35mERROR\x1B[39m: Test message\n' ,
7676 ] ) ;
7777 } ) ;
7878
@@ -96,7 +96,7 @@ describe('github', () => {
9696
9797 strictEqual ( process . stdout . write . mock . callCount ( ) , 1 ) ;
9898 deepStrictEqual ( callsArgs , [
99- '::notice ::[21:00:00.000] \x1B[31mFATAL\x1B[39m: Test message\n' ,
99+ '::error ::[21:00:00.000] \x1B[31mFATAL\x1B[39m: Test message\n' ,
100100 ] ) ;
101101 } ) ;
102102
Original file line number Diff line number Diff line change 22
33import * as core from '@actions/core' ;
44
5+ import { LogLevel } from '../constants.mjs' ;
56import { prettifyLevel } from '../utils/colors.mjs' ;
67import { prettifyTimestamp } from '../utils/time.mjs' ;
78
89const actions = {
9- debug : core . debug ,
10- info : core . notice ,
11- warn : core . warning ,
12- error : core . error ,
13- fatal : core . error ,
10+ [ LogLevel . debug ] : core . debug ,
11+ [ LogLevel . info ] : core . notice ,
12+ [ LogLevel . warn ] : core . warning ,
13+ [ LogLevel . error ] : core . error ,
14+ [ LogLevel . fatal ] : core . error ,
1415} ;
1516
1617/**
@@ -35,7 +36,7 @@ export const github = ({
3536
3637 const logMessage = `[${ time } ] ${ prettyLevel } ${ module ? ` (${ module } )` : '' } : ${ message } ` ;
3738
38- const logFn = actions [ level ] || core . notice ;
39+ const logFn = actions [ level ] ?? core . notice ;
3940
4041 logFn ( logMessage , {
4142 file : file ?. path ,
You can’t perform that action at this time.
0 commit comments