{"id":15478377,"url":"https://github.com/helpers/logging-helpers","last_synced_at":"2026-02-19T01:02:59.992Z","repository":{"id":23153020,"uuid":"26508444","full_name":"helpers/logging-helpers","owner":"helpers","description":"Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.","archived":false,"fork":false,"pushed_at":"2018-10-24T02:30:21.000Z","size":19,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-29T17:07:20.293Z","etag":null,"topics":["console","error","handlebars","helper","helpers","lodash","log","logging","success","warn"],"latest_commit_sha":null,"homepage":null,"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/helpers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-11T22:44:58.000Z","updated_at":"2023-12-05T06:26:24.000Z","dependencies_parsed_at":"2022-08-21T20:31:03.735Z","dependency_job_id":null,"html_url":"https://github.com/helpers/logging-helpers","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpers%2Flogging-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpers%2Flogging-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpers%2Flogging-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpers%2Flogging-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helpers","download_url":"https://codeload.github.com/helpers/logging-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250262870,"owners_count":21401767,"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":["console","error","handlebars","helper","helpers","lodash","log","logging","success","warn"],"created_at":"2024-10-02T04:03:49.621Z","updated_at":"2026-02-19T01:02:52.935Z","avatar_url":"https://github.com/helpers.png","language":"JavaScript","readme":"# logging-helpers [![NPM version](https://img.shields.io/npm/v/logging-helpers.svg?style=flat)](https://www.npmjs.com/package/logging-helpers) [![NPM monthly downloads](https://img.shields.io/npm/dm/logging-helpers.svg?style=flat)](https://npmjs.org/package/logging-helpers) [![NPM total downloads](https://img.shields.io/npm/dt/logging-helpers.svg?style=flat)](https://npmjs.org/package/logging-helpers) [![Linux Build Status](https://img.shields.io/travis/helpers/logging-helpers.svg?style=flat\u0026label=Travis)](https://travis-ci.org/helpers/logging-helpers)\n\n\u003e Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save logging-helpers\n```\n\n## Usage\n\nThe main export is the `log` helper function with other helpers decorated as properties on this function. Some apps, like [assemble](https://github.com/assemble/assemble), [verb](https://github.com/verbose/verb) and [generate](https://github.com/generate/generate) support this format. However, a non-enumberalbe `toObject` method is exposed for registering directly with engines like [handlebars](http://www.handlebarsjs.com/)\n\nExample:\n\n```js\nvar loggingHelpers = require('logging-helpers');\nvar hbs = require('handlebars');\n\nhbs.registerHelper('log', helpers);\n// register all of the other helpers\nhbs.registerHelper(helpers.toObject);\n```\n\n## Template examples\n\nHandlebars:\n\n```handlebars\n{{log \"%s\" \"this is a message\"}}\n{{info \"%s\" \"this is a message\"}}\n{{warning \"%s\" \"this is a message\"}}\n{{warn \"%s\" \"this is a message\"}}  \u003c!-- alias for \"warning\" --\u003e\n{{success \"%s\" \"this is a message\"}}\n{{error \"%s\" \"this is a message\"}}\n{{danger \"%s\" \"this is a message\"}}  \u003c!-- alias for \"error\" --\u003e\n{{ok \"%s\" \"this is a message\"}}\n{{bold \"%s\" \"this is a message\"}}\n{{_debug this}}\n{{_inspect foo.bar}}\n```\n\nLo-Dash or Underscore:\n\n```html\n\u003c%= log(\"%s\", \"this is a message\") %\u003e\n\u003c%= info(\"%s\", \"this is a message\") %\u003e\n\u003c%= warn(\"%s\", \"this is a message\") %\u003e\n\u003c%= warning(\"%s\", \"this is a message\") %\u003e\n\u003c%= error(\"%s\", \"this is a message\") %\u003e\n\u003c%= bold(\"%s\", \"this is a message\") %\u003e\n\u003c%= _debug(data) %\u003e\n\u003c%= _inspect(foo.bar) %\u003e\n```\n\n[Verb](https://github.com/verbose/verb) (uses lodash-style templates, but with special delimiters to avoid delimiter collision in documentation):\n\n```js\n{%= log(\"%s\", \"this is a message\") %}\n{%= info(\"%s\", \"this is a message\") %}\n{%= bold(\"%s\", \"this is a message\") %}\n{%= warn(\"%s\", \"this is a message\") %}\n{%= error(\"%s\", \"this is a message\") %}\n{%= debug(data) %}\n{%= inspect(foo.bar) %}\n```\n\n## Usage with [assemble](https://github.com/assemble/assemble)\n\nThis should work with [assemble](https://github.com/assemble/assemble), [verb](https://github.com/verbose/verb), [generate](https://github.com/generate/generate), [update](https://github.com/update/update) or any application based on [templates](https://github.com/jonschlinkert/templates).\n\n```js\nvar helpers = require('logging-helpers');\nvar assemble = require('assemble');\nvar app = assemble();\napp.helpers(helpers);\n```\n\nYou can now use the helpers like this:\n\n```handlebars\n{{log \"%s\" \"this is a message\"}}\n{{info \"%s\" \"this is a message\"}}\n{{warning \"%s\" \"this is a message\"}}\n{{warn \"%s\" \"this is a message\"}}  \u003c!-- alias for \"warning\" --\u003e\n{{success \"%s\" \"this is a message\"}}\n{{error \"%s\" \"this is a message\"}}\n{{danger \"%s\" \"this is a message\"}}  \u003c!-- alias for \"error\" --\u003e\n{{ok \"%s\" \"this is a message\"}}\n{{bold \"%s\" \"this is a message\"}}\n{{_debug this}}\n{{_inspect foo.bar}}\n```\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 21, 2017._","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpers%2Flogging-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelpers%2Flogging-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpers%2Flogging-helpers/lists"}