New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tilog

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tilog

New-wheel logger, just do it

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

tilog

A static logger configuration for NodeJs service, wrapping winston.

  • Short logging api: as it should be
  • File based, rotated log (daily plus size limit)
  • Console output is enabled in dev mode
  • Log file/module name, instance name (for cluster mode)
  • NodeJs default console.log/util.format convension
  • Tiny code
const log = require('tilog')(__filename)

//easy api
log('basic')

//explicit level
log.debug('basic')
log.info('basic')
log.warn('basic')
log.error('basic')

//formatting
let d = {a: 1, b:'Transylvania'}
log('Formatting: %d %s %j', 12345, 'welcome to', d)
log('test error with stack:', new Error('demo'))

//Customizable label for cluster environment to distinguish child processes
log.config({
	instanceName: 'ClusterWorker/1'
})
log('With instance info. Useful for cluster environment')

const log2 = require('tilog')('/anotherModule/index.js')
log2('Message from another module')

tilog screenshot

Keywords

log

FAQs

Package last updated on 14 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts