couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Smith <...@apache.org>
Subject Please review console.log() branch
Date Tue, 05 Feb 2013 10:15:47 GMT
I want to merge this: https://github.com/apache/couchdb/commits/console_log

Please comment if you have a moment. It is two changes.

## console.log()

In addition to good old log(), there is console.log(). It behaves exactly
like Node.js. It supports a format string and variable arguments.

    console.log("doc id is %s and count is %d", doc._id, doc.count)
    console.dir("doc = %j", doc) // JSON format
    console.log("Full request\n%s", util.inspect(req))
    return {
      body: util.format("<title>%s</title", title)
    }
    // etc.

## Separate log file for JavaScript

_config/log/view_file = "js.log"

If this is set, every log() or console.log() will additionally go to this
file. There are no timestamps, no formatting. It is like a console.

I was thinking of adding /_log support, cleaning it up, and then merging it
in.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message