@solarity/hardhat-migrate
Version:
The simplest way to deploy smart contracts
29 lines • 924 B
JavaScript
export function underline(str) {
return `\u001b[4m${str}\u001b[0m`;
}
/* eslint-disable no-console */
export function SuppressLogs(value, _context) {
return function (...args) {
const originalLog = console.log;
console.log = () => { };
try {
const result = value.apply(this, args);
// If the method returns a promise, restore logs after it settles
if (result && typeof result.then === "function") {
return result.finally(() => {
console.log = originalLog;
});
}
// Sync path: restore immediately
console.log = originalLog;
return result;
}
catch (e) {
// Ensure restoration on error
console.log = originalLog;
throw e;
}
};
}
/* eslint-enable no-console */
//# sourceMappingURL=logging.js.map