{"_id":"spruce","_rev":"19-a5ff37e6866a33631a15b72b0ff08da2","name":"spruce","description":"Spruce Configurable Logging Library","dist-tags":{"latest":"1.0.3"},"versions":{"0.1.0":{"name":"spruce","version":"0.1.0","description":"Spruce Configurable Logging Library","homepage":"https://github.com/MarkPNeyer/spruce","keywords":["log","logger","logging"],"author":{"name":"Mark P Neyer","email":"Mark@MarkPNeyer.com","url":"http://www.markpneyer.com"},"repository":{"type":"git","url":"git://github.com/MarkPNeyer/spruce.git"},"bugs":{"url":"http://github.com/MarkPNeyer/spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"depdenencies":{},"devDependencies":{},"main":"./lib/spruce.js","_id":"spruce@0.1.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.6","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"12c2f5555bfa3d9d6060ea2611ea2c466279ddf4","tarball":"https://registry.npmjs.org/spruce/-/spruce-0.1.0.tgz","integrity":"sha512-zT7ixwTCPnPDnQupVdhAxkIALnZbqrgrsav7ka6RWbEtTOB5A9E5IfCckb1kRtJQRIxhuk4vBrO0Hg9mg4g6Yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMEhiHtfpLWSBz10biDuEZvZd70/qrPmtbagYX6sTX4QIhANNnblObnlXpfrhPZyfd9EVmx6xHhNJU6w0R+A5uvofv"}]}},"0.1.1":{"name":"spruce","version":"0.1.1","description":"Spruce Configurable Logging Library","homepage":"https://github.com/MarkPNeyer/spruce","keywords":["log","logger","logging"],"author":{"name":"Mark P Neyer","email":"Mark@MarkPNeyer.com","url":"http://www.markpneyer.com"},"repository":{"type":"git","url":"git://github.com/MarkPNeyer/spruce.git"},"bugs":{"url":"http://github.com/MarkPNeyer/spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"depdenencies":{},"devDependencies":{},"main":"./lib/spruce.js","_id":"spruce@0.1.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.6","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"29446f4c3b348622a8c87b5111a4e0cd574e22fe","tarball":"https://registry.npmjs.org/spruce/-/spruce-0.1.1.tgz","integrity":"sha512-v8vllaa6tKS0ANB+KUaDjZRhj4ag6oan+LdHQf5X6IZeakgzQgH5uzLUEWNu8ZBVefxtEtsnKUGygxBom55sOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ66AewkPX+zPzl0wyMvb2Ev2YvWpZ9EbbY0a9IdeO/wIhAJBFjD3SJkaAAS4wRPqPEqS8YNRfXP5NyalLvl6OBwI/"}]}},"0.1.2":{"name":"spruce","version":"0.1.2","description":"Spruce Configurable Logging Library","homepage":"https://github.com/MarkPNeyer/spruce","keywords":["log","logger","logging"],"author":{"name":"Mark P Neyer","email":"Mark@MarkPNeyer.com","url":"http://www.markpneyer.com"},"repository":{"type":"git","url":"git://github.com/MarkPNeyer/spruce.git"},"bugs":{"url":"http://github.com/MarkPNeyer/spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"depdenencies":{},"devDependencies":{},"main":"./lib/spruce.js","_id":"spruce@0.1.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.6","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"7d485cc754fc4d7b6522d3d99df86d262c8af17b","tarball":"https://registry.npmjs.org/spruce/-/spruce-0.1.2.tgz","integrity":"sha512-puUIL/NAI7pVIcXncQlseTMCzFwZQYcaV9yUPTVSLxJJJJHu+mYLU5Z3ol01QKuxnX0xhAV1ef49aO0SyrXvRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFciR0dA2i+ybWdkc77ViN9aB+ZQNffoR+r9DSFeuz30AiEAxufm2t2izTBCeaN7oLaF8PQ/2bANsrVw511vvWZGeuo="}]}},"1.0.0":{"name":"spruce","version":"1.0.0","description":"Spruce Configurable Logging Library","homepage":"https://github.com/uber/uber-node-spruce","keywords":["log","logger","logging"],"author":{"name":"Amos Barreto","email":"amos@uber.com","url":"https://github.com/uber/uber-node-spruce"},"repository":{"type":"git","url":"git@github.com:uber/uber-node-spruce.git"},"bugs":{"url":"https://github.com/uber/uber-node-spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"dependencies":{},"devDependencies":{},"main":"./lib/spruce.js","_npmUser":{"name":"squamos","email":"amos.barreto@gmail.com"},"_id":"spruce@1.0.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"704450c7ed15a6a709d55e7e39e0c4b74c4defb8","tarball":"https://registry.npmjs.org/spruce/-/spruce-1.0.0.tgz","integrity":"sha512-MnegZ1IctbDrjc3X1w5M9Qc7ECZiWTwxyNUyI6TWZUYe88rJQBcWDgAB0WHx+7HPy6M/aQ9GEsPrCdEW0oU66A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsQjIiHYYr5GLHnjvj5yYBJQREhjmow5NCLz5AqbK2xwIgFazqmPmuV1VedFnGzbwncHDBGlWYnqrQeIhkwdGtpvw="}]},"maintainers":[{"name":"markpneyer","email":"mark@markpneyer.com"},{"name":"squamos","email":"amos.barreto@gmail.com"}]},"1.0.1":{"name":"spruce","version":"1.0.1","description":"Spruce Configurable Logging Library","homepage":"https://github.com/uber/uber-node-spruce","keywords":["log","logger","logging"],"author":{"name":"Amos Barreto","email":"amos@uber.com","url":"https://github.com/uber/uber-node-spruce"},"repository":{"type":"git","url":"git@github.com:uber/uber-node-spruce.git"},"bugs":{"url":"https://github.com/uber/uber-node-spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"dependencies":{},"devDependencies":{},"main":"./lib/spruce.js","_npmUser":{"name":"squamos","email":"amos.barreto@gmail.com"},"_id":"spruce@1.0.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"d05c5133b0d9c7f86a191f87cdc2b024a8e25af8","tarball":"https://registry.npmjs.org/spruce/-/spruce-1.0.1.tgz","integrity":"sha512-wvIfeqyFVypEL6GLs5gFOYPuMOpHI4erdpRz0CRBpQPX4X+KU2Qbz1yVN8kSlAnolIkNvWez/dwDE46fgDpdCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFiOXUmuq324dIP1zydIXCTEFt7rZky9UflE/johrEvIAiAnQMWv2Uw/BOLjtI6ZVO/jO4MiQuo+dZmwf5mH4ckafQ=="}]},"maintainers":[{"name":"squamos","email":"amos.barreto@gmail.com"}]},"1.0.2":{"name":"spruce","version":"1.0.2","description":"Spruce Configurable Logging Library","homepage":"https://github.com/uber/uber-node-spruce","keywords":["log","logger","logging"],"author":{"name":"Amos Barreto","email":"amos@uber.com","url":"https://github.com/uber/uber-node-spruce"},"repository":{"type":"git","url":"git@github.com:uber/uber-node-spruce.git"},"bugs":{"url":"https://github.com/uber/uber-node-spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"dependencies":{},"devDependencies":{},"main":"./lib/spruce.js","_npmUser":{"name":"squamos","email":"amos.barreto@gmail.com"},"_id":"spruce@1.0.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"c53ad3ef6b4774f4ee46a215b3d19b87f05294a1","tarball":"https://registry.npmjs.org/spruce/-/spruce-1.0.2.tgz","integrity":"sha512-JO9Qokt9O2fJSo3YtCJlw3RS2HbqcQGvINfCrJnHw4Gt+QdiHL7FEnx6DD4aFBauR/jZ7liDcKdf3s6NJ8rYDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDvslhw6KFwYqUvEPz3u1RB9eweLYjzQkFxEkXJejjVbAiBODum+e23CspJKaAuXFDnB8FjCOfvARCOGEGmtqGmOWg=="}]},"maintainers":[{"name":"squamos","email":"amos.barreto@gmail.com"}]},"1.0.3":{"name":"spruce","version":"1.0.3","description":"Spruce Configurable Logging Library","homepage":"https://github.com/uber/uber-node-spruce","keywords":["log","logger","logging"],"author":{"name":"Amos Barreto","email":"amos@uber.com","url":"https://github.com/uber/uber-node-spruce"},"contributors":[{"name":"David Ellis","email":"ellis@uber.com"}],"repository":{"type":"git","url":"git@github.com:uber/uber-node-spruce.git"},"bugs":{"url":"https://github.com/uber/uber-node-spruce/issues/"},"directories":{"lib":"./lib","test":"./tests"},"dependencies":{"sprintf":"0.1.0"},"devDependencies":{},"main":"./lib/spruce.js","readme":"Spruce\n===========\n\nSpruce is a configurable node.js logging library. Its coolest feature is the ability to use custom logging handlers, so you can do something like this:\n\n     var emailDevelopers = function(message){\n            sendMail( {'from' : 'error@mcbain.com',\n                        'to' : 'devs@mcbain.com',\n                        'subject' : 'error: '+message,\n                        'body' : makeMessageBody(message)});\n            //do some hackery here\n        };\n     var options = { 'methods' :\n                        { 'error' : \n                            { 'handlers' :  [ emailDevelopers ]},\n                        }\n                    }; \n\n    var spruce = require('spruce').init(options);\n    spruce.error('My eyes! The goggles do nothing!');\n\nand then all of your developers will get an email from McBain deploring the quality of his optical protection. \n\nUsage\n-----\n\nDownload and add to your code, or use npm:\n\n    npm install spruce\n\nThen, do this:\n\n    var spruce = require('spruce').init();\n\nThe variable 'spruce' will now be be an object with several functions: \n\n    { 'info' : [Function],\n      'trace' : [Function],\n      'debug' : [Function],\n      'warn' : [Function],\n      'error' : [Function]}\n\n Each of these functions takes a single argument, the message, and logs it and some other cool stuff to the console. For example, this code:\n\n    spruce.info('Yes! we have no bonanza!')\n\nproduces this output:\n    [2011-05-20 09:16:05.030] INFO  [readme.js:3:8] - Yes! we have no bonanaza!\n    \nOptions \n-------\nEverybody loves options! Spruce is highly configurable, so you can do a lot of neat stuff with it.  Here are the features it supports:\n\n - colored console printing.\n - custom date formatting.\n - custom log levels.\n - print module name and line number of log message.\n - handler functions for any log level.\n - will not pee on the floor or complain about your taste in clothes.\n\nHere are the default options:\n\n    var defaultOptions = {\n            'dateFormat' : '[%y-%m-%d %H:%M:%S.%l]',\n            'stripNewlines' : true,\n            'methods' : {\n                'info' : {'lineNum' : false,\n                            'color' : 30,\n                            'handlers': []},\n                'trace' : {'lineNum' : true,\n                            'color' : 30,\n                            'handlers': []},\n                'debug' : {'lineNum' : true,\n                            'color' : 34,\n                            'handlers' : []},\n                'warn' : {'lineNum' : true,\n                         'color' : 35,\n                        'handlers' : []},\n                'error': {'lineNum' : true,\n                          'color' :  31,\n                          'handlers' : []},\n                },\n            'moduleName' : null,\n            'useColor' : false,\n    };\n\n\n`stripNewlines` determines whether the logger should remove newlines from\nall log messages. This is useful when logging things like xml or json.\n\n`dateFormat` is the string used to specify how the date should appear. it uses standard strftime\noptions, although I did not implement day of the year (%j) or week of the year (%u).  \n\n`methods` is a config object for each of the  log methods you want to have in your logging system. The options for each of these objects are explained below.\n\nBy default, every logger returned will have have `info`, `trace`, `debug`, `info`, `warn`, and `error` methods. You are free to add as many as you would like. \n\n`moduleName` is used to print the name of the module where the log message occured. if `moduleName` is null, only the file and line where the error occurred is printed. Note that `moduleName`  only takes effect for methods that have the `lineNum` option enabled. To use this effectively, you will need to specify the module you're in every time you require the spruce module.\n\n`useColor` determines whether to use awesome colors or boring plain text.\n\nMethod Options\n----- \n`color`: what color to display this text in, if `useColor` is enabled.\n\n`lineNum`: whether to compute a stack trace to get the line number. This is disabled for the `info` level be default, for performance reasons.\n\n`handlers`: a list of single-argument functions to be called with the log message whenever that log method is called.  Using `handlers` you can do things like:\n\n- Email all developers whenever an error occurs\n- Dump all log messages matching a regex into a database\n- Find log messages encoding turing machines that halt for every input and... well, maybe not.\n\nExample\n------\n    var move = function(zig) { //for great justice! }; \n    var opts = {'methods' : {'operator': { 'handlers' : [move]}}}; \n    var spruce = require('spruce').init(opts);\n\n    if (somebodySetUpUsTheBomb())\n        spruce.operator('Main Screen Turn on!')\n\n... and then operator will move the zig when the bomb is set up. \n \nLicense\n-------\nMIT License. Enjoy and Fork!\n\nCredits\n--------\nBased upon [node-logger by igo](https://github.com/igo/node-logger).\n","_id":"spruce@1.0.3","dist":{"shasum":"df43d6212489e983084a3bbc9cc7f9781bde2b48","tarball":"https://registry.npmjs.org/spruce/-/spruce-1.0.3.tgz","integrity":"sha512-s3eneUp8QEkLJyPf/WhOaM0HZxny/QVM03I9dgqXQH6NpGPyUgNvNIqk4BduFKkH871e7wvVjXorXkkdGBuUoA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWf9rsNMCl/rZtofRQBnZ2WvTBsYuH0YTuEUMz/kqAbgIhAPFPCkIAlcL+ithWyGERA4XnT20PVDZ2DfsCqrCdhd0x"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"squamos","email":"amos.barreto@gmail.com"},"maintainers":[{"name":"squamos","email":"amos.barreto@gmail.com"}]}},"maintainers":[{"name":"squamos","email":"amos.barreto@gmail.com"}],"time":{"modified":"2022-06-26T23:11:01.816Z","created":"2011-04-19T20:51:08.156Z","0.1.0":"2011-04-19T20:51:08.502Z","0.1.1":"2011-05-18T00:24:36.556Z","0.1.2":"2011-05-20T16:44:34.372Z","1.0.0":"2012-02-07T04:16:16.743Z","1.0.1":"2012-03-29T21:37:05.222Z","1.0.2":"2012-04-11T00:53:44.913Z","1.0.3":"2012-10-25T23:46:48.496Z"},"author":{"name":"Amos Barreto","email":"amos@uber.com","url":"https://github.com/uber/uber-node-spruce"},"repository":{"type":"git","url":"git@github.com:uber/uber-node-spruce.git"}}