Skip to content

A simple logging library and want to look for a girlfriend...

License

Notifications You must be signed in to change notification settings

bluedapp/lucky-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lucky-logger

npm version

A simple logging library...

Installation

$ npm install lucky-logger

Usage

const Koa = require('koa')
const Router = require('koa-router')
const luckylogger = require('lucky-logger')

const app = new Koa()
const router = new Router()

const logger = luckylogger()

router.get('/', (ctx, next) => {
  logger.info({
    notice: 'I lose what i love most...'
  })
  logger.warn({
    notice: 'I also want to look for a girlfriend...'
  })
  try {
    alert(err)
  } catch (err) {
    logger.error(err, {
      notice: 'Who is my love match?'
    })
  }

  ctx.body = 'Hello World'
})

app.use(router.routes())

app.listen(0258)

Options

// defaults options
{
  appName: 'app',
  dailyRotateFile: {
    datePattern: 'YYYY-MM-DD',
    maxFiles: '30d',
    maxSize: '100m',
  },
  fileName: 'app',
  root: path.join(path.dirname(__dirname), '../logs'),
}

License

MIT License

About

A simple logging library and want to look for a girlfriend...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published