Skip to content

Instantly share code, notes, and snippets.

@armand1m
Created January 27, 2017 03:18
Show Gist options
  • Save armand1m/8ed56c7587d351134386457fb35e9326 to your computer and use it in GitHub Desktop.
Save armand1m/8ed56c7587d351134386457fb35e9326 to your computer and use it in GitHub Desktop.
Helpful Logger using Squeak.js
'use strict'
const Squeak = require('squeak')
const logger = new Squeak()
.type('sync', {
color: 'cyan',
prefix: '+ sync'
})
.type('event', {
color: 'cyan',
prefix: '+ event'
})
.type('info', {
color: 'cyan',
prefix: '+ info'
})
.type('fail', {
color: 'red',
prefix: '! failed'
})
.type('error', {
color: 'red',
prefix: '! error'
})
.type('debug', {
color: 'yellow',
prefix: '! debug'
})
.type('warn', {
color: 'yellow',
prefix: '! warn'
})
.type('server/env', {
color: 'magenta',
prefix: '+ server/env'
})
.type('server/env/error', {
color: 'red',
prefix: '! server/env'
})
.type('server/info', {
color: 'cyan',
prefix: '+ server/info'
})
.type('server/route', {
color: 'green',
prefix: '+ server/route'
})
.type('database/info', {
color: 'cyan',
prefix: '+ database/info'
})
.type('database/sync', {
color: 'magenta',
prefix: '+ database/sync'
})
.type('$driver/info', {
color: 'cyan',
prefix: '+ $driver/info'
})
.type('$driver/debug', {
color: 'yellow',
prefix: '! $driver/debug'
})
.type('$driver/error', {
color: 'red',
prefix: '! $driver/error'
})
.type('$interface/$event', {
color: 'magenta',
prefix: '+ $interface/$event'
})
module.exports = logger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment