mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 01:30:10 +08:00
30 lines
674 B
TypeScript
30 lines
674 B
TypeScript
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;
|
|
|
|
isDebug: () => boolean;
|
|
|
|
startGroup: (name: string) => void;
|
|
endGroup: () => void;
|
|
}
|
|
|
|
export function getActionsLogger(): Logger {
|
|
return core;
|
|
}
|
|
|
|
export function getRunnerLogger(debugMode: boolean): Logger {
|
|
return {
|
|
debug: debugMode ? console.debug : () => undefined,
|
|
info: console.info,
|
|
warning: console.warn,
|
|
error: console.error,
|
|
isDebug: () => debugMode,
|
|
startGroup: () => undefined,
|
|
endGroup: () => undefined,
|
|
};
|
|
}
|