17 lines
385 B
TypeScript
17 lines
385 B
TypeScript
import { ArgumentsCamelCase } from 'yargs'
|
|
|
|
const _log = console.debug;
|
|
const logOverride = function() {
|
|
const new_args: any[] = ['[DEBUG]']
|
|
// @ts-ignore
|
|
new_args.push.apply(new_args, arguments);
|
|
_log.apply(null, new_args);
|
|
};
|
|
|
|
export const prepareVerbose = (argv: ArgumentsCamelCase) => {
|
|
console.debug = () => {}
|
|
if(argv.verbose) {
|
|
console.debug = logOverride
|
|
}
|
|
}
|