-e = (err) ->
+e = (err, level=1) ->
   return unless err
   err = new Error err unless err instanceof Error
   stack = e.stack err, arguments.callee

    err.lineNumber = stack[0].getLineNumber()
    err.columnNumber = stack[0].getColumnNumber()
    err.context = stack[0].getThis()
  middle err for middle in e.middleware

e.middleware = []
e.use = (fn) -> e.middleware.push fn



# Included middleware
e.console = (err) ->
  contents = "[#{err.levelName}][#{new Date()}] - #{err.message}"
  contents += " thrown in #{err.fileName}" if err.fileName?
  contents += "::#{err.functionName}" if err.functionName?
  contents += ":#{err.lineNumber}" if err.lineNumber?
