Add a CLI interface to the upload-sarif action
This commit is contained in:
parent
bcf676e52d
commit
6d7a135fea
15 changed files with 355 additions and 89 deletions
26
src/logging.ts
Normal file
26
src/logging.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import * as core from '@actions/core';
|
||||
|
||||
export interface Logger {
|
||||
debug: (message: string) => void;
|
||||
info: (message: string) => void;
|
||||
warning: (message: string) => void;
|
||||
error: (message: string) => void;
|
||||
|
||||
startGroup: (name: string) => void;
|
||||
endGroup: () => void;
|
||||
}
|
||||
|
||||
export function getActionsLogger(): Logger {
|
||||
return core;
|
||||
}
|
||||
|
||||
export function getCLILogger(): Logger {
|
||||
return {
|
||||
debug: console.debug,
|
||||
info: console.info,
|
||||
warning: console.warn,
|
||||
error: console.error,
|
||||
startGroup: () => undefined,
|
||||
endGroup: () => undefined,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue