mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Merge branch 'main' into verbose-logging
This commit is contained in:
commit
be6a6dccd9
62 changed files with 1243 additions and 41 deletions
|
|
@ -27,12 +27,22 @@ function emptyLine() {
|
|||
writeInformation("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {...any} optionalParams
|
||||
* @returns {void}
|
||||
*/
|
||||
function writeInformation(message, ...optionalParams) {
|
||||
if (isSilentMode()) return;
|
||||
|
||||
writeOrBuffer(() => console.log(message, ...optionalParams));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {...any} optionalParams
|
||||
* @returns {void}
|
||||
*/
|
||||
function writeWarning(message, ...optionalParams) {
|
||||
if (isSilentMode()) return;
|
||||
|
||||
|
|
@ -42,6 +52,11 @@ function writeWarning(message, ...optionalParams) {
|
|||
writeOrBuffer(() => console.warn(message, ...optionalParams));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {...any} optionalParams
|
||||
* @returns {void}
|
||||
*/
|
||||
function writeError(message, ...optionalParams) {
|
||||
if (!isCi()) {
|
||||
message = chalk.red(message);
|
||||
|
|
@ -71,6 +86,19 @@ function writeOrBuffer(messageFunction) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} Spinner
|
||||
* @property {(message: string) => void} succeed
|
||||
* @property {(message: string) => void} fail
|
||||
* @property {() => void} stop
|
||||
* @property {(message: string) => void} setText
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
*
|
||||
* @returns {Spinner}
|
||||
*/
|
||||
function startProcess(message) {
|
||||
if (isSilentMode()) {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue