{"name":"loggy","version":"0.2.2","description":"Dead-simple colored logger for stdout.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/paulmillr/loggy.git"},"keywords":["log","logger","tasty","simple"],"author":{"name":"Paul Miller","url":"paulmillr.com"},"license":"MIT","dependencies":{"ansi-color":"~0.2.1","growl":"~1.8.1","date-utils":"~1.2.17"},"gitHead":"7262fccd78369ecbbaf7db7d42911a1a62dd1013","bugs":{"url":"https://github.com/paulmillr/loggy/issues"},"homepage":"https://github.com/paulmillr/loggy#readme","_id":"loggy@0.2.2","_shasum":"7edc85706a82d761ce9cef868f1afbad84165427","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.7","_npmUser":{"name":"paulmillr","email":"paul@paulmillr.com"},"maintainers":[{"name":"paulmillr","email":"paul@paulmillr.com"}],"dist":{"shasum":"7edc85706a82d761ce9cef868f1afbad84165427","tarball":"http://registry-npm.ywwl.com/loggy/download/loggy-0.2.2.tgz","integrity":"sha512-qyFE/iDthCuPHibLVQDh5YEzmILOywfWh0D7YbYrT86uxNL9YLigWOZQnUtBABB3JEvPzOLwAyu85Zpi6rIWKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5Se3AamblEOk0smbJwFk1hFV5ujF0LxCDq4XT9o9G5AiEA7IgjLYcCF55vfeWeSGWIwEgAqbepDHBtDM0X3rxCTxU="}],"size":3208,"noattachment":false,"key":"/loggy/-/loggy-0.2.2.tgz"},"directories":{},"readme":"# loggy\n\nColorful stdstream dead-simple logger for node.js.\n\n* Logs stuff to stdout (`log`, `info`, `success`).\n* Logs errors & warnings to stderr (`warn`, `error`).\n* Adds colors to log types (e.g. `warn`, `info` words will be colored). Uses lightweight [colorette](https://github.com/jorgebucaran/colorette).\n* Emits system notifications for errors with [native-notifier](https://github.com/paulmillr/native-notifier).\n* Tracks whether any error was logged (useful for changing process exit code).\n* No 3rd-party deps (Growl etc.)\n\n<img width=\"762\" alt=\"Screen Shot 2019-09-26 at 18 51 56\" src=\"https://user-images.githubusercontent.com/574696/65704227-d0870c00-e08e-11e9-8d65-41ed6c1ecc59.png\">\n\n![Screen Shot 2013-04-21 at 03 26 41](https://cloud.githubusercontent.com/assets/574696/22355836/d5a57152-e435-11e6-8b22-6aca8b4e79b1.png)\n\nInstall with `npm install loggy`.\n\n## Usage\n\nExample:\n\n```javascript\nconst logger = require('loggy');\n\n// \"05:48:30 - log: Hello, loggy\" to stdout.\n// \"info\" word is cyan.\nlogger.info('Hello', 'loggy');\n\n// \"05:48:30 - warn: Deprecated\" to stderr.\n// \"warn\" word is yellow.\nlogger.warn('Deprecated');\n\n// Logs \"05:48:30 - error: Oops\" to stderr.\n// \"error\" word is red.\n// Emits system notifications with title \"Error\" and message \"Oops”.\nlogger.error('Oops');\n\n// Exit with proper code.\nprocess.on('exit', () => {\n   process.exit(logger.errorHappened ? 1 : 0);\n});\n\n// Disable colors.\nlogger.colors = false;\n\n// Disable system notifications.\nlogger.notifications = false;\n\n// Enable notifications for more methods\nlogger.notifications = ['error', 'warn', 'success'];\n\n// Prepend the notifications title\nlogger.notificationsTitle = 'My App';\n\n// Dump stacks of Error objects in errors or warnings\nlogger.dumpStacks = true; // or color of your choice\n```\n\nEnvironment variables:\n\n* `LOGGY_STACKS`: default value for `dumpStacks`. Pass `1` to see the stacks.\n* `FORCE_NO_COLOR`: disables color output in `chalk`. Does not affect `logger.colors`.\n\nMethods:\n\n* `logger.error(...args)` - logs messages in red to stderr, creates notification.\n* `logger.warn(...args)` - logs messages in yellow to stdout.\n* `logger.log(...args)` - logs messages in cyan to stdout.\n* `logger.info`, `logger.success` - logs messages in green to stdout.\n* `logger.format(level)` - function that does color and date formatting.\n\nParams:\n\n* `logger.colors` - mapping of log levels to colors.\n  Can be object, like `{error: 'red', log: 'cyan'}` or `false` (disables colors).\n* `logger.errorHappened` - `false`, changes to `true` if any error was logged.\n* `logger.notifications` - As Boolean, enables or disables notifications for errors, or\n  as Array, list types to trigger notifications, like `['error', 'warn', 'success']`.\n* `logger.notificationsTitle` - String, optional, prepends title in notifications.\n\n## License\n\n[MIT](https://github.com/paulmillr/mit) (c) 2016 Paul Miller (http://paulmillr.com)\n","publish_time":1438882416589,"_cnpm_publish_time":1438882416589,"dist-tags":{"latest":"1.0.8"}}