1
1
mirror of https://github.com/tauri-apps/tauri.git synced 2024-12-22 18:21:35 +03:00
tauri/cli/tauri.js/helpers/logger.js
nothingismagick e58110afd6 chore/upgrades node ()
* chore(checkin): cargo.lock

* feat(upgrades): update and try to fix node tests

* fix(@iarna): replace with @tauri-apps

* chore(deps): upgrade sharp

* feat(env): add env var that works on mac

* feat(deps): upgrade, cleanup and update code

* fix(workflow): env vars

* chore(deps): upgrades

* fix(.gitignore)
2019-11-30 15:39:13 -03:00

20 lines
389 B
JavaScript

const ms = require('ms')
const chalk = require('chalk')
let prevTime
module.exports = function (banner, color = 'green') {
return function (msg) {
const curr = +new Date()
const diff = curr - (prevTime || curr)
prevTime = curr
if (msg) {
console.log(` ${chalk[color](banner)} ${msg} ${chalk.green(`+${ms(diff)}`)}`)
} else {
console.log()
}
}
}