{"_id":"scribe","_rev":"26-91a3a379c9289a9662fb188ebc69e438","name":"scribe","description":"Scribe client","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.1":{"name":"scribe","description":"Scribe client","version":"0.0.1","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.6.0-1"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"devDependencies":{},"_id":"scribe@0.0.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"a346d59b89dfdd830a6bd31d01509c83a3298ae9","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.1.tgz","integrity":"sha512-hmE0z8GxQ7HiOpCYKmYl/W4gzBcJ07FzHzBBgcFod1aQ8cqh+KZncAgjeNW9r+PfYVB+rpskaka2Q9UU1vepqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/vTTbejAGMkpiPq2FTJgkUAopqIoA4znjF7XwEf+GmAiACdXStBk93pAcjgrr02x0g61E0BO6XZMlwHYbZvia61A=="}]},"scripts":{},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}],"directories":{}},"0.0.2":{"name":"scribe","description":"Scribe client","version":"0.0.2","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.6.0-1"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"devDependencies":{},"_id":"scribe@0.0.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"865a955cf1f10591e61cddb094bf9093ef718ff6","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.2.tgz","integrity":"sha512-QJCwMBubYfDiTEiA5OHQ2aMEtJaPDVX4FYbjh/89cpf5IycK2EXslrbSuFk6APJ0yrY9p6XV2p774iP54Z3WBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE1N/ofsFNAErOZnEDLpGVuy0tLJubKY69z2fERxCTKyAiBxGXkHpMHLb43QO2Nph0okQzHGCVuRSJLY4+72Uycc5Q=="}]},"scripts":{},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}],"directories":{}},"0.0.4":{"name":"scribe","description":"Scribe client","version":"0.0.4","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.7.0"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"_id":"scribe@0.0.4","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"45bd441bb3783457cbf89b73565afb414dc20c04","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.4.tgz","integrity":"sha512-SpQWG0dWfCJ+RkJhu3cM3QfgFQCiNp054oN9p6eOzBmFYZP8c3JmvZpvz9J9d6aTBRMcRymWu0cFSjatEVWHuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvVhBS1D91k/G/dUAC0LhpJND6nR57copb1NINGRlgcgIgJmzUBBBjgqL18d4UKuEd+7fCD9zBbkYp/d490mdKR2w="}]},"maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}]},"0.0.5":{"name":"scribe","description":"Scribe client","version":"0.0.5","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.7.0"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"_id":"scribe@0.0.5","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"9cf7b5a0c3e247756bc79786af2eeb600d24393e","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.5.tgz","integrity":"sha512-QgUeTwed78GjbUximNMHEFrNGBDT/7wxB9gVEtGp1ZAjbVZaE/A8MGG8fsqhfWuAJahpC32Gq0pRA1teZovEIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDc1lzN2sojEy4PjERRwsEs36op/XLxKeWenskFZ37TvQIgEvLTubiP60rATsipnvBzkNfNDb/sDaYMrWrjAMYbfbk="}]},"readme":"# node-scribe\nScribe client for node.js. Project also includes a drop-in replacement (Logger) for the default console object.\n## Installation\n    $ npm install scribe\n## Basic example\nExample of sending log entries to scribe server.\n\n    var Scribe = require('scribe').Scribe;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      scribe.send(\"foocategory\", \"foomessage\");\n\n      scribe.close();\n\n    });\n\n## autoReconnect = true\nIf autoReconnect is set to true and connection fails, client will store log entries to queue and flush when connection has been re-established.\n\n## Logger\nLogger is an drop-in replacement for the default console object. Each log entry contains the level, hostname, pid, caller (file and position) and the log message given as parameter. Values are separated by tabulators.\n\n### Log levels\nLevels are defined by the function used or by hand when using the logMessage function.<br />\n    0 : EMERG <br />\n    1 : ALERT <br />\n    2 : CRITICAL (critical)<br />\n    3 : ERROR (error)<br />\n    4 : WARN (warn)<br />\n    5 : NOTICE<br />\n    6 : INFO (info)<br />\n    7 : DEBUG (debug, log)<br />\n\n### Example\nExample of using logger to replace node:s console object.\n\n    var Scribe = require('scribe').Scribe;\n    var Logger = require('scribe').Logger;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n    var logger = new Logger(scribe, \"foobar\");\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      logger.log(\"foomessage\");\n\n      logger.replaceConsole(); // replaces console with logger\n\n      console.log(\"foobar\");\n\n      logger.releaseConsole(); // reverts changes made by replaceConsole();\n\n      scribe.close();\n\n    });\n\n\n## License\n(The MIT License)\n\nCopyright(c) 2011 Applifier Ltd.<br />\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}]},"0.0.7":{"name":"scribe","description":"Scribe client","version":"0.0.7","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.7.0"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"_id":"scribe@0.0.7","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.8.0","_defaultsLoaded":true,"dist":{"shasum":"60d158105e4e76fb55e1ddf343895d2d72302f20","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.7.tgz","integrity":"sha512-i8T4/rsrOUCU8MkM/ef7piajlwF9PVNem73D15N5AGKlfOYcMY854gF6mghSuPpoxZz8Mo+0MOJ5Usuli0SD7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBoTS9S1Uk3wSQuDN3PxscIrYu3+JQhAXmh4Gqx+1R/5AiAH0nvuesBy1gbFiDa7UpXl0Nvt0Uqns86LfryDAeqz9w=="}]},"readme":"# node-scribe\nScribe client for node.js. Project also includes a drop-in replacement (Logger) for the default console object.\n## Installation\n    $ npm install scribe\n## Basic example\nExample of sending log entries to scribe server.\n\n    var Scribe = require('scribe').Scribe;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      scribe.send(\"foocategory\", \"foomessage\");\n\n      scribe.close();\n\n    });\n\n## autoReconnect = true\nIf autoReconnect is set to true and connection fails, client will store log entries to queue and flush when connection has been re-established.\n\n## Logger\nLogger is an drop-in replacement for the default console object. Each log entry contains the level, hostname, pid, caller (file and position) and the log message given as parameter. Values are separated by tabulators.\n\n### Log levels\nLevels are defined by the function used or by hand when using the logMessage function.<br />\n    0 : EMERG <br />\n    1 : ALERT <br />\n    2 : CRITICAL (critical)<br />\n    3 : ERROR (error)<br />\n    4 : WARN (warn)<br />\n    5 : NOTICE<br />\n    6 : INFO (info)<br />\n    7 : DEBUG (debug, log)<br />\n\n### Example\nExample of using logger to replace node:s console object.\n\n    var Scribe = require('scribe').Scribe;\n    var Logger = require('scribe').Logger;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n    var logger = new Logger(scribe, \"foobar\");\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      logger.log(\"foomessage\");\n\n      logger.replaceConsole(); // replaces console with logger\n\n      console.log(\"foobar\");\n\n      logger.releaseConsole(); // reverts changes made by replaceConsole();\n\n      scribe.close();\n\n    });\n\n\n## License\n(The MIT License)\n\nCopyright(c) 2011 Applifier Ltd.<br />\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}]},"0.0.8":{"name":"scribe","description":"Scribe client","version":"0.0.8","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.7.0"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"_id":"scribe@0.0.8","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.8.0","_defaultsLoaded":true,"dist":{"shasum":"307abb502a06a23e29b62564d2c2a0d3b68c9949","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.8.tgz","integrity":"sha512-nshUaa0Aaz0RYa/oURN3Ls8vAD80DJSTWSo0M0iT/Sp2yxT4cRUcNQb7auJq3diVbfXfyBPeRO5qJPRi5WnL8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP07ICzRVPPvm95On3NisiizCPfLSyGzvFBN5qurl17gIhANw0tV2HNwDwx1E0b7G7A97grOL+4cfgDMzy3udX88RP"}]},"readme":"# node-scribe\nScribe client for node.js. Project also includes a drop-in replacement (Logger) for the default console object.\n## Installation\n    $ npm install scribe\n## Basic example\nExample of sending log entries to scribe server.\n\n    var Scribe = require('scribe').Scribe;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      scribe.send(\"foocategory\", \"foomessage\");\n\n      scribe.close();\n\n    });\n\n## autoReconnect = true\nIf autoReconnect is set to true and connection fails, client will store log entries to queue and flush when connection has been re-established.\n\n## Logger\nLogger is an drop-in replacement for the default console object. Each log entry contains the level, hostname, pid, caller (file and position) and the log message given as parameter. Values are separated by tabulators.\n\n### Log levels\nLevels are defined by the function used or by hand when using the logMessage function.<br />\n    0 : EMERG <br />\n    1 : ALERT <br />\n    2 : CRITICAL (critical)<br />\n    3 : ERROR (error)<br />\n    4 : WARN (warn)<br />\n    5 : NOTICE<br />\n    6 : INFO (info)<br />\n    7 : DEBUG (debug, log)<br />\n\n### Example\nExample of using logger to replace node:s console object.\n\n    var Scribe = require('scribe').Scribe;\n    var Logger = require('scribe').Logger;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n    var logger = new Logger(scribe, \"foobar\");\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      logger.log(\"foomessage\");\n\n      logger.replaceConsole(); // replaces console with logger\n\n      console.log(\"foobar\");\n\n      logger.releaseConsole(); // reverts changes made by replaceConsole();\n\n      scribe.close();\n\n    });\n\n# RequestLog\n\nCreates a middleware which will inject every req object with a log object.\nThe log object contains an pseudo-unique id for each request in the req.log.id variable.\n\nIn addition the req.log object contains console.log compatible logging functions:\nlog, info, warn, error, critical.\n\nEach log message logged using those methods is passed into the custom writer() function,\nwhich the user must pass in the factory constructor.\n\nThe writer takes the following arguments:\nfunction writer(level, request_id, line, message), where:\n - level is the numeric log level as defined in Logger:\n     Logger.LOG_DEBUG = 7;\n     Logger.LOG_INFO = 6;\n     Logger.LOG_WARNING = 4;\n     Logger.LOG_ERROR = 3;\n     Logger.LOG_CRITICAL = 2;\n - request_id is the pseudo-randomly generated unique id for the request\n - line is a stacktrace line where the log message was generated, in form of \"/path/to/file.js:line:character\", eg \"/path:tio:file.js:282:24\"\n - message is a concatenated string of all the arguments passed to the log function\n\nHere's an example how we have used the writer to feed log lines to scribe:\n\n    var hostname = require('os').hostname();\n    app.use(RequestLog.factory(function (level, id, line, msg) {\n       var str = RequestLog.formatTimestamp(new Date()) + \"\\t\" + RequestLog.levelNames[level] + \"\\t\" + hostname + \"\\t\" + process.pid + \"\\t\" + line + \"\\t\" + id + \"\\t\" + msg;\n       scribe.send(\"comet\", str);\n    }));\n    \nNote that the req.log object is mostly compatible with the standard console object.\nThis means that you can implement functions which accept an ubique 'logger' argument and you can log messages\nwithin these functions by calling for example logger.error(\"Something bad!\"); Then you can pass the req.log\nobject as the logger object, or simply pass 'console' from within your tests where you don't have access\nto a request related req object.\n\nExample:\n\n\n    // Your function somewhere in your code, not directly related to any express request processing\n    function someFunction(value, logger) {\n      if (value == null) {\n        logger.error(\"Value was null\");\n      }\n    }\n    \n    // Function which is directly related to express, for example a middleware\n    function processRequest(req, res, next) {\n      var value = req.query.value;\n      someFunction(value, req.log);\n      next();\n    }\n    \n    // You can test the someFunction in your TDD environment by passing console instead of req.log:\n    test(\"my test\", function() {\n      someFunction(\"value\", console);\n    }\n\n## License\n(The MIT License)\n\nCopyright(c) 2011 Applifier Ltd.<br />\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}]},"0.0.9":{"name":"scribe","description":"Scribe client","version":"0.0.9","repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"dependencies":{"thrift":"0.7.0"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"_npmUser":{"name":"orktes","email":"jaakko@applifier.com"},"_id":"scribe@0.0.9","devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.8.14","_defaultsLoaded":true,"dist":{"shasum":"551bf03a09a1646be2f9b1743d3303a475594c19","tarball":"https://registry.npmjs.org/scribe/-/scribe-0.0.9.tgz","integrity":"sha512-Z63UknHK4Rcg8C0GjzZLlkNHRdG013K28SohKcAkluSbERUI3XOf3il1dQ5hLeWEMQMEj4zEtVeku2PLDaIARw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICn8iCa2URBhZlXFOgixdencEqR6g3/jOYrUoQyKsmAIAiBMI7FjNG+YeAab5sI2sEMc573Ep4AaxtDKq0G1Au7BNw=="}]},"readme":"# node-scribe\nScribe client for node.js. Project also includes a drop-in replacement (Logger) for the default console object.\n## Installation\n    $ npm install scribe\n## Basic example\nExample of sending log entries to scribe server.\n\n    var Scribe = require('scribe').Scribe;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      scribe.send(\"foocategory\", \"foomessage\");\n\n      scribe.close();\n\n    });\n\n## autoReconnect = true\nIf autoReconnect is set to true and connection fails, client will store log entries to queue and flush when connection has been re-established.\n\n## Logger\nLogger is an drop-in replacement for the default console object. Each log entry contains the level, hostname, pid, caller (file and position) and the log message given as parameter. Values are separated by tabulators.\n\n### Log levels\nLevels are defined by the function used or by hand when using the logMessage function.<br />\n    0 : EMERG <br />\n    1 : ALERT <br />\n    2 : CRITICAL (critical)<br />\n    3 : ERROR (error)<br />\n    4 : WARN (warn)<br />\n    5 : NOTICE<br />\n    6 : INFO (info)<br />\n    7 : DEBUG (debug, log)<br />\n\n### Example\nExample of using logger to replace node:s console object.\n\n    var Scribe = require('scribe').Scribe;\n    var Logger = require('scribe').Logger;\n\n    var scribe = new Scribe(\"localhost\", 1234, {autoReconnect:true});\n    var logger = new Logger(scribe, \"foobar\");\n    scribe.open(function(err){\n\n      if(err) {\n        return console.log(err);\n      }\n\n      logger.log(\"foomessage\");\n\n      logger.replaceConsole(); // replaces console with logger\n\n      console.log(\"foobar\");\n\n      logger.releaseConsole(); // reverts changes made by replaceConsole();\n\n      scribe.close();\n\n    });\n\n# RequestLog\n\nCreates a middleware which will inject every req object with a log object.\nThe log object contains an pseudo-unique id for each request in the req.log.id variable.\n\nIn addition the req.log object contains console.log compatible logging functions:\nlog, info, warn, error, critical.\n\nEach log message logged using those methods is passed into the custom writer() function,\nwhich the user must pass in the factory constructor.\n\nThe writer takes the following arguments:\nfunction writer(level, request_id, line, message), where:\n - level is the numeric log level as defined in Logger:\n     Logger.LOG_DEBUG = 7;\n     Logger.LOG_INFO = 6;\n     Logger.LOG_WARNING = 4;\n     Logger.LOG_ERROR = 3;\n     Logger.LOG_CRITICAL = 2;\n - request_id is the pseudo-randomly generated unique id for the request\n - line is a stacktrace line where the log message was generated, in form of \"/path/to/file.js:line:character\", eg \"/path:tio:file.js:282:24\"\n - message is a concatenated string of all the arguments passed to the log function\n\nHere's an example how we have used the writer to feed log lines to scribe:\n\n    var hostname = require('os').hostname();\n    app.use(RequestLog.factory(function (level, id, line, msg) {\n       var str = RequestLog.formatTimestamp(new Date()) + \"\\t\" + RequestLog.levelNames[level] + \"\\t\" + hostname + \"\\t\" + process.pid + \"\\t\" + line + \"\\t\" + id + \"\\t\" + msg;\n       scribe.send(\"comet\", str);\n    }));\n    \nNote that the req.log object is mostly compatible with the standard console object.\nThis means that you can implement functions which accept an ubique 'logger' argument and you can log messages\nwithin these functions by calling for example logger.error(\"Something bad!\"); Then you can pass the req.log\nobject as the logger object, or simply pass 'console' from within your tests where you don't have access\nto a request related req object.\n\nExample:\n\n\n    // Your function somewhere in your code, not directly related to any express request processing\n    function someFunction(value, logger) {\n      if (value == null) {\n        logger.error(\"Value was null\");\n      }\n    }\n    \n    // Function which is directly related to express, for example a middleware\n    function processRequest(req, res, next) {\n      var value = req.query.value;\n      someFunction(value, req.log);\n      next();\n    }\n    \n    // You can test the someFunction in your TDD environment by passing console instead of req.log:\n    test(\"my test\", function() {\n      someFunction(\"value\", console);\n    }\n\n## License\n(The MIT License)\n\nCopyright(c) 2011 Applifier Ltd.<br />\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}]}},"maintainers":[{"name":"orktes","email":"jaakko@applifier.com"}],"time":{"modified":"2022-06-26T16:48:29.938Z","created":"2011-07-13T10:23:11.105Z","0.0.1":"2011-12-07T09:08:44.792Z","0.0.2":"2011-12-07T09:08:44.792Z","0.0.4":"2011-12-07T10:25:37.863Z","0.0.5":"2012-06-27T14:28:41.156Z","0.0.7":"2012-07-11T12:10:07.703Z","0.0.8":"2012-08-22T09:45:38.464Z","0.0.9":"2013-02-11T14:28:59.206Z"},"author":{"name":"Applifier","email":"opensource@applifier.com"},"repository":{"type":"git","url":"git://github.com/Applifier/node-scribe.git"},"users":{"wenbing":true}}