complete.js
This file
Path
lib/verbose/complete.js
24 lines · 611 bytes · JavaScript
Last changed by
Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
History of this fileTake it
The walk stopped after 200 commits: lines older than 9f65b86 point at it.
100% test coverage (#1018)ehmickybefore adoption9f65b86
line 1why, one step back1import prettyMs from 'pretty-ms';Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
line 2why, one step back2import {isVerbose} from './values.js';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 3–5why, one step back3import {verboseLog} from './log.js';4import {logError} from './error.js';5Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
lines 6–7why, one step back6// When `verbose` is `short|full|custom`, print each command's completion, duration and error7export const logResult = (result, verboseInfo) => {Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199
line 8why, one step back8 if (!isVerbose(verboseInfo)) {100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 9–11why, one step back9 return;10 }11Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
lines 12–13why, one step back12 logError(result, verboseInfo);13 logDuration(result, verboseInfo);100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 14–15why, one step back14};15Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
lines 16–17why, one step back16const logDuration = (result, verboseInfo) => {17 const verboseMessage = `(done in ${prettyMs(result.durationMs)})`;Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199
lines 18–19why, one step back18 verboseLog({19 type: 'duration',Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
line 20why, one step back20 verboseMessage,Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199
line 21why, one step back21 verboseInfo,Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348
line 22why, one step back22 result,Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199
line 23why, one step back23 });100% test coverage (#1018)ehmickybefore adoption9f65b86
line 24why, one step back24};