mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2025-01-24 18:49:04 -05:00
34 lines
732 B
TypeScript
34 lines
732 B
TypeScript
|
import * as actions from "@actions/core";
|
||
|
import * as console from "console";
|
||
|
import Logger from "./logger";
|
||
|
|
||
|
export function getDefaultLogger(): Logger {
|
||
|
return {
|
||
|
fatal: actions.setFailed,
|
||
|
error: actions.warning,
|
||
|
warn: actions.warning,
|
||
|
info: actions.info,
|
||
|
debug: actions.debug
|
||
|
};
|
||
|
}
|
||
|
|
||
|
export function getConsoleLogger(): Logger {
|
||
|
return {
|
||
|
fatal: console.error,
|
||
|
error: console.error,
|
||
|
warn: console.warn,
|
||
|
info: console.info,
|
||
|
debug: console.debug
|
||
|
};
|
||
|
}
|
||
|
|
||
|
export function getEmptyLogger(): Logger {
|
||
|
return {
|
||
|
fatal: () => {},
|
||
|
error: () => {},
|
||
|
warn: () => {},
|
||
|
info: () => {},
|
||
|
debug: () => {}
|
||
|
};
|
||
|
}
|