{"id":14982038,"url":"https://github.com/gulpjs/glogg","last_synced_at":"2025-04-13T04:16:08.910Z","repository":{"id":25153551,"uuid":"28576125","full_name":"gulpjs/glogg","owner":"gulpjs","description":"Global logging utility.","archived":false,"fork":false,"pushed_at":"2024-03-23T22:39:30.000Z","size":23,"stargazers_count":18,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-29T15:14:40.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gulpjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["gulpjs","phated","yocontra"],"tidelift":"npm/gulp","open_collective":"gulpjs"}},"created_at":"2014-12-29T01:27:41.000Z","updated_at":"2023-11-05T01:47:40.000Z","dependencies_parsed_at":"2024-04-01T17:13:15.909Z","dependency_job_id":null,"html_url":"https://github.com/gulpjs/glogg","commit_stats":{"total_commits":23,"total_committers":4,"mean_commits":5.75,"dds":"0.21739130434782605","last_synced_commit":"04a46b2477ce74dcb91d07c69740ebf8b433860c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fglogg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fglogg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fglogg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulpjs%2Fglogg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gulpjs","download_url":"https://codeload.github.com/gulpjs/glogg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138614,"owners_count":21053899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T14:04:41.003Z","updated_at":"2025-04-13T04:16:08.880Z","avatar_url":"https://github.com/gulpjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/gulpjs","https://github.com/sponsors/phated","https://github.com/sponsors/yocontra","https://tidelift.com/funding/github/npm/gulp","https://opencollective.com/gulpjs"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gulpjs.com\"\u003e\n    \u003cimg height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# glogg\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nGlobal logging utility.\n\n## Usage\n\n```js\nvar getLogger = require('glogg');\n\nvar logger = getLogger('my-namespace');\n\n// logs strings\nlogger.debug('The MOST verbose!');\nlogger.info('Some important info');\nlogger.warn('All the warnings to you');\nlogger.error('OH NO! SOMETHING HAPPENED!');\n\n// supports util.format!\nlogger.info('%s style!', 'printf');\n\n// log anything\nlogger.debug({ my: 'obj' });\nlogger.info([1, 2, 3]);\n\n// somewhere else\nlogger.on('info', function (msg) {\n  // do something with msg\n});\n\n// must be handled to avoid crashing process\nlogger.on('error', function (msg) {\n  // now it won't crash\n});\n```\n\n## API\n\n**Note: This module makes no assumptions about the log levels and they will always\nbe emitted. If you are looking to filter some out, your listeners will need to have\nextra logic.**\n\n### getLogger([namespace])\n\nCreate a new logger at the given namespace (or the default if no namespace is provided).\nReturns an augmented [`sparkles`](https://github.com/phated/sparkles) EventEmitter object\nwith 4 methods: `debug()`, `info()`, `warn()` and `error()`. When called, these methods emit\nan event with the same name. If the first argument is a string, the arguments\nare passed through node's `util.format()` before being emitted. Other parts\nof a node program can get the logger by namespace and listen for the events to\nbe emitted.\n\n#### logger.debug(msg, ...args)\n\nEmits a `debug` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n#### logger.info(msg, ...args)\n\nEmits a `info` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n#### logger.warn(msg, ...args)\n\nEmits a `warn` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n#### logger.error(msg, ...args)\n\nEmits a `error` event with the given `msg`.\n\nIf the first argument is a string, all arguments are passed to node's\n`util.format()` before being emitted.\n\nIf the first argument is not a string, all arguments will be emitted directly.\n\n**Note: You must handle this event in some way or the node process will crash\nwhen an `error` event is emitted.**\n\n#### logger.on(event, fn)\n\nStandard API from node's `EventEmitter`. Use this to listen for events from\nthe logger methods.\n\n## License\n\nMIT\n\n\u003c!-- prettier-ignore-start --\u003e\n[downloads-image]: https://img.shields.io/npm/dm/glogg.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/glogg\n[npm-image]: https://img.shields.io/npm/v/glogg.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/glogg/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/actions/workflow/status/gulpjs/glogg/dev.yml?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/glogg\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glogg/master.svg?style=flat-square\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulpjs%2Fglogg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgulpjs%2Fglogg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulpjs%2Fglogg/lists"}