mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-06-05 03:16:29 +00:00
Add quiet input to suppress info-level log output (#898)
## Summary Adds a new `quiet` input (default: `false`) that suppresses `info`-level log output when set to `true`. Only warnings and errors are shown. Contributes to: #868
This commit is contained in:
committed by
GitHub
parent
e07f2ac4b7
commit
a92cb43098
21
src/utils/logging.ts
Normal file
21
src/utils/logging.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as core from "@actions/core";
|
||||
|
||||
let quiet: boolean | undefined;
|
||||
|
||||
function isQuiet(): boolean {
|
||||
if (quiet === undefined) {
|
||||
quiet =
|
||||
typeof core.getInput === "function" && core.getInput("quiet") === "true";
|
||||
}
|
||||
return quiet;
|
||||
}
|
||||
|
||||
export function info(msg: string): void {
|
||||
if (!isQuiet()) {
|
||||
core.info(msg);
|
||||
}
|
||||
}
|
||||
|
||||
export const warning = core.warning;
|
||||
export const error = core.error;
|
||||
export const debug = core.debug;
|
||||
Reference in New Issue
Block a user