{"_id":"debug-caller","_rev":"12-6f658302fc35cfe73df2c80ecb266a2a","name":"debug-caller","description":"Automatic filename namespace for debug","dist-tags":{"latest":"2.2.0"},"versions":{"0.1.0":{"name":"debug-caller","description":"The debug module with caller support","version":"0.1.0","author":{"name":"Dylan Smith"},"repository":{"type":"git","url":"https://github.com/dylants/debug-caller.git"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"homepage":"https://github.com/dylants/debug-caller","licenses":[{"type":"MIT","url":"https://github.com/dylants/debug-caller/raw/master/LICENSE"}],"keywords":["debug","logger","log","caller","filename","namespace","path"],"files":["LICENSE","lib"],"main":"./lib/debug-caller","scripts":{"prepublish":"npm prune","test":"jasmine-node --test-dir test --matchall --color --verbose","test-watch":"jasmine-node --test-dir test --matchall --color --autotest --watch lib"},"dependencies":{"debug":"^2.1.3","caller":"^1.0.0"},"devDependencies":{"jasmine-node":"^1.14.5","rewire":"^2.3.1"},"_id":"debug-caller@0.1.0","dist":{"shasum":"d54bd91798f4aef62ef26a6712fe7f58acbce485","tarball":"https://registry.npmjs.org/debug-caller/-/debug-caller-0.1.0.tgz","integrity":"sha512-3lIBClFLPW1J7pFWwBlu9zRFOXy+erSUQF2O45OCZJj5Vfm9ofnpizCooQ6rF853gZBQXXg/gu+gWEySIQeQAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCUiKK9H0CUskctaBsY4rI+RokqBnvdmNDTBSiGslukAiEAwoih/5865PI+F/Cm2f7OFMI5yxlUOiT7laYE4vanPJY="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dylants","email":"dylantsmith@gmail.com"},"maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}]},"1.0.0":{"name":"debug-caller","description":"Automatic filename namespace for debug","version":"1.0.0","author":{"name":"Dylan Smith"},"repository":{"type":"git","url":"https://github.com/dylants/debug-caller.git"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"homepage":"https://github.com/dylants/debug-caller","licenses":[{"type":"MIT","url":"https://github.com/dylants/debug-caller/raw/master/LICENSE"}],"keywords":["debug","logger","log","caller","filename","namespace","path"],"files":["LICENSE","lib"],"main":"./lib/debug-caller","scripts":{"prepublish":"npm prune","test":"jasmine-node --test-dir test --matchall --color --verbose","test-watch":"jasmine-node --test-dir test --matchall --color --autotest --watch lib"},"dependencies":{"debug":"^2.1.3","caller":"^1.0.0"},"devDependencies":{"jasmine-node":"^1.14.5","rewire":"^2.3.1"},"_id":"debug-caller@1.0.0","dist":{"shasum":"3809ce4f88f3851c65a26d5cc6900c9aebecb327","tarball":"https://registry.npmjs.org/debug-caller/-/debug-caller-1.0.0.tgz","integrity":"sha512-1I1P8nKEY1JLkx7M3ch5RSrjLIp1Lr1N/eyqTiWoWUI/cOX73A2X0zW7jNILB1ts3+N3tm0F4BydY+pUXM1aBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICRI5FCkhXCdcsqrjK8kocVe/RPgiKhj48Y36jNyTOp6AiEAm4IcBCiyA+bOAPqCLD3RwJAXnczYnfBtJT2kHGL1WHs="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dylants","email":"dylantsmith@gmail.com"},"maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}]},"1.0.1":{"name":"debug-caller","description":"Automatic filename namespace for debug","version":"1.0.1","author":{"name":"Dylan Smith"},"repository":{"type":"git","url":"https://github.com/dylants/debug-caller.git"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"homepage":"https://github.com/dylants/debug-caller","licenses":[{"type":"MIT","url":"https://github.com/dylants/debug-caller/raw/master/LICENSE"}],"keywords":["debug","logger","log","caller","filename","namespace","path"],"files":["LICENSE","lib"],"main":"./lib/debug-caller","scripts":{"prepublish":"npm prune","test":"jasmine-node --test-dir test --matchall --color --verbose","test-watch":"jasmine-node --test-dir test --matchall --color --autotest --watch lib"},"dependencies":{"debug":"^2.1.3","caller":"^1.0.0"},"devDependencies":{"jasmine-node":"^1.14.5","rewire":"^2.3.1"},"_id":"debug-caller@1.0.1","dist":{"shasum":"f8e1304982ace6e39f1d734acfaf5ff42b25feee","tarball":"https://registry.npmjs.org/debug-caller/-/debug-caller-1.0.1.tgz","integrity":"sha512-MXVIQB6xZotEjPKJdN/CKzdWPLhdqra3P/k1V8IVT7iNrmkXbWVWAqySaRYjtagvzhtlJpen+vLjupiWmLy1oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCng8H3S5fJyiugJFJaKxYDmBXD02W/81tbA9rbxyfpVwIhAPV0/evn3Wyuq1MBu6wV1oadqZG8wLbgiSlr+TtOG89F"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dylants","email":"dylantsmith@gmail.com"},"maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}]},"2.0.0":{"name":"debug-caller","description":"Automatic filename namespace for debug","version":"2.0.0","author":{"name":"Dylan Smith"},"repository":{"type":"git","url":"https://github.com/dylants/debug-caller.git"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"homepage":"https://github.com/dylants/debug-caller","licenses":[{"type":"MIT","url":"https://github.com/dylants/debug-caller/raw/master/LICENSE"}],"keywords":["debug","logger","log","caller","filename","namespace","path"],"files":["LICENSE","lib"],"main":"./lib/debug-caller","scripts":{"prepublish":"npm prune","test":"jasmine-node --test-dir test --matchall --color --verbose","test-watch":"jasmine-node --test-dir test --matchall --color --autotest --watch lib"},"dependencies":{"debug":"^2.1.3","caller":"^1.0.0","xtend":"^4.0.0"},"devDependencies":{"jasmine-node":"^1.14.5","rewire":"^2.3.1"},"_id":"debug-caller@2.0.0","dist":{"shasum":"d8e563275a9333f87a238d36889e2ec76ab3943d","tarball":"https://registry.npmjs.org/debug-caller/-/debug-caller-2.0.0.tgz","integrity":"sha512-USZLCiGCJbrle8RecxqdQUJZmXrT6iKKjgvKoZUDNJC9iNcEhuESquhBCQFYLeFO1zJzB17M4Qa8Lze3X3OXcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHdP0bQZGcSc9tGGHsMDDqXiU/IpGQn7Dw8qq2Ruq9p3AiA0qp9wtgGWM2nqp7twY9aDBUf/P1ryOYwRYMnLjcw7iw=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dylants","email":"dylantsmith@gmail.com"},"maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}]},"2.1.0":{"name":"debug-caller","description":"Automatic filename namespace for debug","version":"2.1.0","author":{"name":"Dylan Smith"},"repository":{"type":"git","url":"https://github.com/dylants/debug-caller.git"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"homepage":"https://github.com/dylants/debug-caller","licenses":[{"type":"MIT","url":"https://github.com/dylants/debug-caller/raw/master/LICENSE"}],"keywords":["debug","logger","log","caller","filename","namespace","path"],"files":["LICENSE","lib"],"main":"./lib/debug-caller","scripts":{"prepublish":"npm prune","test":"jasmine-node --test-dir test --matchall --color --verbose","test-watch":"jasmine-node --test-dir test --matchall --color --autotest --watch lib"},"dependencies":{"debug":"^2.1.3","caller":"^1.0.0","xtend":"^4.0.0"},"devDependencies":{"jasmine-node":"^1.14.5","rewire":"^2.3.1"},"_id":"debug-caller@2.1.0","dist":{"shasum":"f51685ca13e91d8c7c152c55a47229b2c75ce737","tarball":"https://registry.npmjs.org/debug-caller/-/debug-caller-2.1.0.tgz","integrity":"sha512-dVt7+w7EnAhLHoDSxg9OX8WFFZepugPTFgoS8SYLT0ETqeVUdzWPcINNBY/PaDg9V3klu/XtUY6H5SkT8otLfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzGIisD8MILT/gOZi1MLCIXAHOYcAStyL3suAm+wEuRwIhAIBO00byPJnfYBAUG9u4n1TZhnUSWezF2lqHmrkPkCtx"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dylants","email":"dylantsmith@gmail.com"},"maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}]},"2.2.0":{"name":"debug-caller","description":"Automatic filename namespace for debug","version":"2.2.0","author":{"name":"Dylan Smith"},"repository":{"type":"git","url":"git+https://github.com/dylants/debug-caller.git"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"homepage":"https://github.com/dylants/debug-caller","licenses":[{"type":"MIT","url":"https://github.com/dylants/debug-caller/raw/master/LICENSE"}],"keywords":["debug","logger","log","caller","filename","namespace","path"],"files":["LICENSE","lib"],"main":"./lib/debug-caller","scripts":{"prepublish":"npm prune","test":"jasmine-node --test-dir test --matchall --color --verbose","test-watch":"jasmine-node --test-dir test --matchall --color --autotest --watch lib"},"dependencies":{"debug":"^2.1.3","caller":"^1.0.0","xtend":"^4.0.0"},"devDependencies":{"jasmine-node":"^1.14.5","rewire":"^2.3.1"},"gitHead":"b54c0f1d3825ef5015624f6f874ea6d955c08d92","_id":"debug-caller@2.2.0","_shasum":"642ebedcd4b33835a3f4c19d3145ec302cd87ccc","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"dylants","email":"dylantsmith@gmail.com"},"maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}],"dist":{"shasum":"642ebedcd4b33835a3f4c19d3145ec302cd87ccc","tarball":"https://registry.npmjs.org/debug-caller/-/debug-caller-2.2.0.tgz","integrity":"sha512-8BtyStfvDf5GVvXdLbFw4ZctI4hBNRCf9XWRYQjosoyoih48IghvXcihSQXo9fuRmfwmOGG9vR0k/631nwK+nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUnERIj1wJqA5xg+r0BXM5FxMcXLCi0BMJ7NlAtPwuUAiEAyyUsSL/xPHxTZFOFqT4ZpimVFBojpfM6AxYGMohjH2A="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/debug-caller-2.2.0.tgz_1485555154709_0.4066034937277436"}}},"readme":"# debug-caller #\n\n[![Build Status](https://travis-ci.org/dylants/debug-caller.svg)](https://travis-ci.org/dylants/debug-caller) [![NPM version](https://badge.fury.io/js/debug-caller.svg)](http://badge.fury.io/js/debug-caller)\n\n[![NPM](https://nodei.co/npm/debug-caller.svg?downloads=true)](https://nodei.co/npm/debug-caller/)\n\nA wrapper around the [`debug`](https://github.com/visionmedia/debug) module,\nproviding the additional ability to determine the calling file name for `debug`'s\nnamespace using [`caller`](https://github.com/totherik/caller). Get automatic\nunique namespaces each time you use `debug`!\n\n## Quick Examples ##\n\n### Basic usage ###\n\n```javascript\n// foo.js\n\nvar logger = require(\"debug-caller\")(\"my-app\");\n\nlogger.log(\"logging data\");  // \"my-app:foo logging data\"\n```\n\n### Used in a logging utility (recommended) ###\n\n```javascript\n// logger.js\n\nvar debugCaller = require(\"debug-caller\");\n\nmodule.exports = function() {\n    // set a depth of 2 to avoid using this file within debug statements\n    // (since this is just a passthrough for logging)\n    return debugCaller(\"my-app\", {\n        depth: 2\n    });\n};\n```\n\n```javascript\n// foo.js\n\nvar logger = require(\"./logger\")();\n\nlogger.log(\"logging data\");  // \"my-app:foo logging data\"\n```\n\n```javascript\n// bar.js\n\nvar logger = require(\"./logger\")();\n\nlogger.log(\"doing work\");  // \"my-app:bar doing work\"\n\nlogger.error(\"something went wrong!\");  // \"my-app:bar something went wrong!\"\n```\n\n## Configuration ##\n\nWhen you invoke `debug-caller`, you must specify an application name (or module\nname) as the first parameter. The second parameter is an (optional) options object\nwhich can contain any of the following:\n\n### `depth` : <`number`> ###\n\nWhen using `caller` to find the calling file name, this states how high up the\nstack to look for the name. If you do not specify the depth, it will default to `1`,\nusing the immediate calling file name to build the namespace for the debug instance.\n\n### `randomColors` : <`boolean`> ###\n\nBy default, `debug-caller` will assign fixed colors to the two `debug` instances\nreturned: the `log` instance will always use `white` while the `error` instance\nwill always use `red`. To use random colors for each `debug` instance, pass in\n`true` for this option. The default value for this option is `false`.\n\nNote: this is only for TTY output.\n\n### `logColor` : <`number`> ###\n\nBy default, `debug-caller` will assign the color white(7) to the `log` debug instance. To set a custom color pass in a number (0-7).\n\n* 0: gray\n* 1: red\n* 2: green\n* 3: yellow\n* 4: blue\n* 5: pink\n* 6: light blue\n* 7: white\n\nThis option will be ignored if randomColors is set to `true`.\n\n### `errorColor` : <`number`> ###\n\nBy default, `debug-caller` will assign the color red(1) to the `error` debug instance. To set a custom color pass in a number (0-7).\n\n* 0: gray\n* 1: red\n* 2: green\n* 3: yellow\n* 4: blue\n* 5: pink\n* 6: light blue\n* 7: white\n\nThis option will be ignored if randomColors is set to `true`.\n\n## API ##\n\nThe `debug-caller` module provides two separate instances of `debug` using\nthe same namespace for each. The purpose is to provide the user with a function\nto use for console.log (stdout) and console.error (stderr).\n\n### log() ###\n\nBinds the logging to `console.log` (stdout) for the debug messages.\n\n### error() ###\n\nBinds the logging to `console.error` (stderr) for the debug messages.\n\n### namespace ###\n\nReturns the generated `namespace` used when configuring the `debug` instance.\n\n## Access Debug ##\n\nIf you need access to the `debug` module directly, it's available off the\nrequire'd `debug-caller` object. For instance, to enable `debug` output by default\nwithin your application (or module), you can enable it within your `logger`:\n\n```javascript\n// logger.js\n\nvar debugCaller = require(\"debug-caller\");\n\n// enable debug output for our app\ndebugCaller.debug.enable(\"my-app*\");\n\nmodule.exports = function() {\n    // set a depth of 2 to avoid using this file within debug statements\n    // (since this is just a passthrough for logging)\n    return debugCaller(\"my-app\", {\n        depth: 2\n    });\n};\n```\n\n## Etc ##\n\n- Licence: [MIT](https://github.com/dylants/debug-caller/blob/master/LICENSE)\n- Dependency Status: [![Dependency Status](https://david-dm.org/dylants/debug-caller.svg)](https://david-dm.org/dylants/debug-caller)\n","maintainers":[{"name":"dylants","email":"dylantsmith@gmail.com"}],"time":{"modified":"2022-06-14T22:05:42.865Z","created":"2015-03-15T03:46:56.778Z","0.1.0":"2015-03-15T03:46:56.778Z","1.0.0":"2015-03-15T16:01:29.884Z","1.0.1":"2015-03-20T18:03:06.347Z","2.0.0":"2015-03-20T18:24:48.407Z","2.1.0":"2015-08-11T02:18:20.597Z","2.2.0":"2017-01-27T22:12:36.588Z"},"homepage":"https://github.com/dylants/debug-caller","keywords":["debug","logger","log","caller","filename","namespace","path"],"repository":{"type":"git","url":"git+https://github.com/dylants/debug-caller.git"},"author":{"name":"Dylan Smith"},"bugs":{"url":"https://github.com/dylants/debug-caller/issues"},"readmeFilename":"README.md"}