     return cb null, body
 
   debug: (prefix, data)->
-    return unless @_debug
-    data = JSON.stringify data, null, ' ' unless data?.constructor is String
-    if (lines = data.split '\n').length > 30
-      console.log "#{prefix}> #{line}" for line in lines[..30]
-      console.log "#{prefix}>   ... total: #{lines.length} lines ..."
-    else
-      console.log data.replace /^/mg, "#{prefix}> "
+    @emit 'debug', prefix, data
 
   _post: (url, qs, data, cb)->
     url += "?"

    @_jar = request.jar()
    if options.cookie
      @_jar._jar = jarson.fromJSON options.cookie

    await @_reload defer e
    return cb e if e

path = require 'path'
md5 = require 'MD5'
jarson = require 'jarson'
{
  EventEmitter
} = require 'events'

module.exports = class Lixian extends EventEmitter
  headers: 
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36'
    'Accept': 'text/html'
