{"id":24079913,"url":"https://github.com/hypersoftllc/qc-log_api","last_synced_at":"2025-02-26T23:48:12.942Z","repository":{"id":65481579,"uuid":"90907703","full_name":"hypersoftllc/qc-log_api","owner":"hypersoftllc","description":"API for Logging in JavaScript.","archived":false,"fork":false,"pushed_at":"2017-08-18T01:26:54.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-02-10T21:48:13.393Z","etag":null,"topics":["logging"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypersoftllc.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":"2017-05-10T20:57:11.000Z","updated_at":"2017-05-16T14:32:35.000Z","dependencies_parsed_at":"2023-01-25T10:05:12.154Z","dependency_job_id":null,"html_url":"https://github.com/hypersoftllc/qc-log_api","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/hypersoftllc%2Fqc-log_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypersoftllc%2Fqc-log_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypersoftllc%2Fqc-log_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypersoftllc%2Fqc-log_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypersoftllc","download_url":"https://codeload.github.com/hypersoftllc/qc-log_api/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240953063,"owners_count":19884022,"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":["logging"],"created_at":"2025-01-09T22:26:35.124Z","updated_at":"2025-02-26T23:48:12.923Z","avatar_url":"https://github.com/hypersoftllc.png","language":"TypeScript","readme":"# qc-log_api\r\n\r\n[![Build Status][travis-svg]][travis-url]\r\n[![Coverage Status][coverage-image]][coverage-url]\r\n[![License][license-image]][license-url]\r\n[![Downloads][downloads-image]][downloads-url]\r\n\r\n[![npm badge][npm-badge-png]][package-url]\r\n\r\nThis project defines an API for a logging system in JavaScript.  If you have\r\never used a logging system, then you are aware of its benefits over using\r\nsomething that simply prints to the console, standard out, or standard error.\r\nA logging system is configurable and allows one to determine which log\r\nmessages are logged, where they are logged, and the format in which they are\r\nlogged.\r\n\r\nThere are several logging systems available for the JavaScript environment and\r\nat the start of a project you may not be ready to spend the time on testing\r\nand choosing a particular logging system.  This is where this logging API\r\nsteps in.  It has the minimal API typically used by most logging systems.  By\r\nusing this logging API now, it will be easier to upgrade to a full-blown\r\nlogging system implementation that closely match this API.\r\n\r\nAlthough this is designed to help enforce a particular logging API, it has a\r\nbasic implementation which logs the messages to the `console` using the most\r\nappropriate method.  For example, a WARN level message is logged to\r\n`console.warn`.\r\n\r\n\r\n## Installation\r\n\r\n```sh\r\nnpm install --save qc-log_api\r\n```\r\n\r\n\r\n## Usage\r\n\r\n```js\r\nimport * as printf from 'printf';\r\n\r\nimport { Log } from 'qc-log_api';\r\n\r\nlet LOG = Log.Factory.get('example');\r\n\r\nLOG.trace('I am a %s level message', 'TRACE');\r\nLOG.debug('I am a %s level message', 'DEBUG');\r\nLOG.info('I am an %s level message', 'INFO');\r\nLOG.warn('I am a %s level message', 'WARN');\r\nLOG.error('I am an %s level message', 'ERROR');\r\nLOG.fatal('I am a %s level message', 'FATAL');\r\n\r\nLOG.trace(printf, 'I am a %s level message', 'TRACE');\r\n\r\nlet field_length_between = function (field_name, min_len, max_len) {\r\n    return printf('%s must have a length between %d and %d.', field_name, min_len, max_len);\r\n};\r\nLOG.warn(field_length_between, 'Username', 3, 50);\r\nLOG.warn(field_length_between, 'Password', 8, 20);\r\n\r\nLOG.logAt(Log.Level.TRACE, '%s must have a length between %d and %d.', 'Password', 8, 20);\r\nLOG.logAt(Log.Level.DEBUG, '%s must have a length between %d and %d.', 'Password', 8, 20);\r\nLOG.logAt(Log.Level.INFO, '%s must have a length between %d and %d.', 'Password', 8, 20);\r\nLOG.logAt(Log.Level.WARN, '%s must have a length between %d and %d.', 'Password', 8, 20);\r\nLOG.logAt(Log.Level.ERROR, '%s must have a length between %d and %d.', 'Password', 8, 20);\r\nLOG.logAt(Log.Level.FATAL, '%s must have a length between %d and %d.', 'Password', 8, 20);\r\n```\r\n\r\n\r\n[coverage-image]: https://coveralls.io/repos/github/hypersoftllc/qc-log_api/badge.svg?branch=master\r\n[coverage-url]: https://coveralls.io/github/hypersoftllc/qc-log_api?branch=master\r\n[downloads-image]: http://img.shields.io/npm/dm/qc-log_api.svg\r\n[downloads-url]: http://npm-stat.com/charts.html?package=qc-log_api\r\n[license-image]: http://img.shields.io/npm/l/qc-log_api.svg\r\n[license-url]: LICENSE\r\n[package-url]: https://npmjs.org/package/qc-log_api\r\n[npm-badge-png]: https://nodei.co/npm/qc-log_api.png?downloads=true\u0026stars=true\r\n[travis-svg]: https://travis-ci.org/hypersoftllc/qc-log_api.svg?branch=master\r\n[travis-url]: https://travis-ci.org/hypersoftllc/qc-log_api\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypersoftllc%2Fqc-log_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypersoftllc%2Fqc-log_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypersoftllc%2Fqc-log_api/lists"}