log4js = require 'log4js'

module.exports = (options) ->
  config =
    appenders: [
      {
        type: 'console'
        category: 'connect-concierge'
      }
    ],

    levels:
      'connect-concierge': if process.env.NODE_ENV is 'test' then 'OFF' else if options.debugMode then 'DEBUG' else if options.verbose then 'INFO' else 'WARN'

  log4js.configure(config)
  return log4js