     @storage.zadd [@key(), stamp, body], (err, response) =>
        return console.log "WARNING: Failed to store: '#{who}: #{what}' @ #{stmp}: #{err}" if err
 
+  # Trim the logging buffer to `@options.days` since we don't care about
+  # being a general purpose logger.
   trim: ->
-    days = 3
+    days = @options.days
     end = Date.now() - (
       days *  # Days
       24   *  # Hours

Redis = require 'redis'

module.exports = (robot) ->
  # Configure redis the same way that redis-brain does.
  info = Url.parse process.env.REDISTOGO_URL or
    process.env.REDISCLOUD_URL or
    process.env.BOXEN_REDIS_URL or
    'redis://localhost:6379'
  client = Redis.createClient(info.port, info.hostname)
  client.auth info.auth.split(":")[1] if info.auth

  buffer = new PantsBuffer(client)

  # We listen to everything.
  # Everything.

      msg.message.text.trim()
    )

  # Ask for what currently serves as "output"
  robot.respond /ayp(\s+(me)?)?\s*$/i, (msg) ->
    msg.reply "HOLD YOUR FUCKING HORSES"

class PantsBuffer
  # The zset that stores the buffer of logs
  key: -> "#{@options.prefix}:buffer"

  # Store and timestamp `who` saying `what`.
  # Also trims the set with `@trim` to the configured
  # length
  store: (who, what) ->
    do @trim
    stamp = Date.now()
