couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [5/5] git commit: Document the new logging and formatting API
Date Mon, 11 Feb 2013 03:29:10 GMT
Updated Branches:
  refs/heads/1676-feature-console_log [created] ec8d2c863


Document the new logging and formatting API


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ec8d2c86
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ec8d2c86
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ec8d2c86

Branch: refs/heads/1676-feature-console_log
Commit: ec8d2c8630e17f1e1a2d537fb70950f370009789
Parents: e45c689
Author: Jason Smith (work) <jhs@iriscouch.com>
Authored: Mon Feb 11 03:10:16 2013 +0000
Committer: Jason Smith (work) <jhs@iriscouch.com>
Committed: Mon Feb 11 03:10:16 2013 +0000

----------------------------------------------------------------------
 share/doc/src/query-servers.rst |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ec8d2c86/share/doc/src/query-servers.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/query-servers.rst b/share/doc/src/query-servers.rst
index e77abd7..860e167 100644
--- a/share/doc/src/query-servers.rst
+++ b/share/doc/src/query-servers.rst
@@ -132,6 +132,37 @@ modules and functions:
       [Sat, 03 Nov 2012 17:38:02 GMT] [info] [<0.7543.0>] OS Process #Port<0.3289>
Log :: Processing doc 8d300b86622d67953d102165dbe99467
 
 
+.. function:: util.format(format, [...])
+
+   :param format: A printf-like format string, compatible with Node.js.
+   :return: The formatted string
+
+   .. code-block:: javascript
+
+      function(doc){
+        var key = util.format("%s%s", doc.prefix, doc.suffix);
+        emit(key, null);
+      }
+
+.. function:: console.log(format, [...])
+
+   :param format: A printf-like format string, compatible with Node.js.
+
+   .. code-block:: javascript
+
+      function(doc){
+        console.log('Processing doc %s rev %j', doc._id, doc._rev);
+        emit(doc['_id'], null);
+      }
+
+   On map function run in CouchDB logs (e.g. at `/var/log/couchdb/couch.log`)
+   you may find next record:
+
+   .. code-block:: text
+
+      [Sat, 03 Nov 2012 17:38:02 GMT] [info] [<0.7543.0>] OS Process #Port<0.3289>
Log :: Processing doc 8d300b86622d67953d102165dbe99467 rev "269-fda3ccf153724273fe458cf72ce2bcf8"
+
+
 .. function:: provides(key, func)
 
    Registers callable handler for specified MIME key.


Mime
View raw message