companion: make logs to properly format objects

This commit is contained in:
Ifedapo Olarewaju 2019-03-22 10:31:36 +01:00
parent 700b557c3b
commit 867f473e7e

View file

@ -45,5 +45,7 @@ exports.debug = (msg, tag) => {
const log = (msg, tag, level) => {
// @TODO add some colors based on log level
const time = new Date().toISOString()
console.log(`uppy: ${time} [${level}] ${tag || ''} ${msg}`)
// exclude msg from template string so values such as error objects
// can be well formatted
console.log(`uppy: ${time} [${level}] ${tag || ''}`, msg)
}