[Groonga-commit] groonga/express-droonga at c24d8a5 [master] Add debug function

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jul 21 14:56:47 JST 2013


Kouhei Sutou	2013-07-21 14:56:47 +0900 (Sun, 21 Jul 2013)

  New Revision: c24d8a5a1a47045ed632dc580207c38dfac89820
  https://github.com/groonga/express-droonga/commit/c24d8a5a1a47045ed632dc580207c38dfac89820

  Message:
    Add debug function
    
    It uses the same style as node.js built-in library such as net.js. You
    can enable debug print by "NODE_DEBUG=express-droonga".

  Added files:
    lib/debug.js

  Added: lib/debug.js (+13 -0) 100644
===================================================================
--- /dev/null
+++ lib/debug.js    2013-07-21 14:56:47 +0900 (7986acd)
@@ -0,0 +1,13 @@
+var util = require('util');
+
+var debug;
+if (process.env.NODE_DEBUG && /express-droonga/.test(process.env.NODE_DEBUG)) {
+  debug = function() {
+    console.error('express-droonga:',
+                  util.format.apply(util, arguments));
+  };
+} else {
+  debug = function() {};
+}
+
+module.exports = debug;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index