Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 1why, one step back
1import prettyMs from 'pretty-ms';

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

line 2why, one step back
2import {isVerbose} from './values.js';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 3–5why, one step back
3import {verboseLog} from './log.js';
4import {logError} from './error.js';5

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

lines 6–7why, one step back
6// When `verbose` is `short|full|custom`, print each command's completion, duration and error
7export const logResult = (result, verboseInfo) => {

Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199

line 8why, one step back
8 if (!isVerbose(verboseInfo)) {

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 9–11why, one step back
9 return;
10 }11

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

lines 12–13why, one step back
12 logError(result, verboseInfo);
13 logDuration(result, verboseInfo);

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 14–15why, one step back
14};
15

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

lines 16–17why, one step back
16const logDuration = (result, verboseInfo) => {
17 const verboseMessage = `(done in ${prettyMs(result.durationMs)})`;

Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199

lines 18–19why, one step back
18 verboseLog({
19 type: 'duration',

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

line 20why, one step back
20 verboseMessage,

Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199

line 21why, one step back
21 verboseInfo,

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

line 22why, one step back
22 result,

Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199

line 23why, one step back
23 });

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 24why, one step back
24};