ScottONeal / githooked

githooked is a tiny library and companion CLI tool for handling GitHub webooks.
MIT License
8 stars 1 forks source link

Add ability to set a log file from CLI and API #2

Open ScottONeal opened 8 years ago

ScottONeal commented 8 years ago

It would be nice to have all output from githooked to log to specific file, something like:

CLI

githooked -r refs/heads/master -p 9001 --log-file="$HOME/githooked.log" 'echo "pushed to master!"'

Should add an options parameter as the third argument API

githooked('refs/heads/master', 'pushed to master', { logFile: 'githooked.log' })
ScottONeal commented 8 years ago

@mbland, you mentioned some other other options you wanted passed into bodyParser. I'm thinking of adding a json key to the configuration object, as well as being able to pass in custom middleware.

githooked('refs/heads/master', 'pushed to master', {
  logFile: '/share/logs/githooked.log',
  json: {
    limit: '5MB',
    strict: true 
  },
  middleware: [ // Array of Middlewares that will be added to githooked
    require('connect-timeout'),
    function(req,res,next) { /*do something */ next(); }
  ]
})
ScottONeal commented 8 years ago

Implemented options argument in 0b3ee9a0157265c72fef7c70d48868380a5f9cb3

TODO: update README