Skip to content

Commit

Permalink
refactor: replace text badge with figures
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Dec 1, 2022
1 parent 6533911 commit ed58b78
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"detect-newline": "^4.0.0",
"dotenv": "^16.0.3",
"execa": "^6.1.0",
"figures": "^5.0.0",
"fs-extra": "^11.1.0",
"get-stream": "^6.0.1",
"git-log-parser": "^1.2.0",
Expand Down
43 changes: 37 additions & 6 deletions packages/core/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import signale from 'signale'
import figures from 'figures'

export function getLogger({
stdout,
Expand All @@ -12,12 +13,42 @@ export function getLogger({
scope: 'srm',
stream: stdout,
types: {
info: { color: 'magenta', label: '', badge: 'ℹ', stream: [stdout] },
error: { color: 'red', label: '', badge: '✖', stream: [stderr] },
log: { color: 'magenta', label: '', badge: '•', stream: [stdout] },
success: { color: 'green', label: '', badge: '✔', stream: [stdout] },
complete: { color: 'red', label: '', badge: '❤', stream: [stdout] },
start: { color: 'cyan', label: '', badge: '✈', stream: [stdout] },
info: {
color: 'magenta',
label: '',
badge: figures.info,
stream: [stdout],
},
error: {
color: 'red',
label: '',
badge: figures.cross,
stream: [stderr],
},
log: {
color: 'magenta',
label: '',
badge: figures.bullet,
stream: [stdout],
},
success: {
color: 'green',
label: '',
badge: figures.tick,
stream: [stdout],
},
complete: {
color: 'red',
label: '',
badge: figures.heart,
stream: [stdout],
},
start: {
color: 'cyan',
label: '',
badge: figures.home,
stream: [stdout],
},
},
})
}
41 changes: 34 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed58b78

Please sign in to comment.