{"id":13453969,"url":"https://github.com/watson/console-log-level","last_synced_at":"2025-04-12T21:28:32.058Z","repository":{"id":25391693,"uuid":"28820281","full_name":"watson/console-log-level","owner":"watson","description":"The most simple logger imaginable","archived":false,"fork":false,"pushed_at":"2023-12-03T14:06:30.000Z","size":36,"stargazers_count":111,"open_issues_count":8,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-30T01:36:55.122Z","etag":null,"topics":[],"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/watson.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-01-05T16:12:38.000Z","updated_at":"2024-05-30T11:29:46.000Z","dependencies_parsed_at":"2023-12-03T15:22:40.352Z","dependency_job_id":"95cf6da5-24a9-4b64-9796-cd624d9a5d22","html_url":"https://github.com/watson/console-log-level","commit_stats":{"total_commits":38,"total_committers":3,"mean_commits":"12.666666666666666","dds":"0.23684210526315785","last_synced_commit":"afb5409f1ad19e594f9ad2b7849619168cd184a5"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fconsole-log-level","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fconsole-log-level/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fconsole-log-level/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Fconsole-log-level/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson","download_url":"https://codeload.github.com/watson/console-log-level/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633976,"owners_count":21136957,"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-07-31T08:00:49.902Z","updated_at":"2025-04-12T21:28:32.036Z","avatar_url":"https://github.com/watson.png","language":"JavaScript","readme":"# console-log-level\n\nA dead simple logger. Will log to STDOUT or STDERR depending on the\nchosen log level. It uses `console.info`, `console.warn` and\n`console.error` and hence supports the same API.\n\nLog levels supported: trace, debug, info, warn, error and fatal.\n\n[![npm](https://img.shields.io/npm/v/console-log-level.svg)](https://www.npmjs.com/package/console-log-level)\n[![Build status](https://travis-ci.org/watson/console-log-level.svg?branch=master)](https://travis-ci.org/watson/console-log-level)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\n## Installation\n\n```\nnpm install console-log-level\n```\n\n## Example usage\n\n```js\nvar log = require('console-log-level')({ level: 'info' })\n\nlog.trace('a') // will not do anything\nlog.debug('b') // will not do anything\nlog.info('c')  // will output 'c\\n' on STDOUT\nlog.warn('d')  // will output 'd\\n' on STDERR\nlog.error('e') // will output 'e\\n' on STDERR\nlog.fatal('f') // will output 'f\\n' on STDERR\n```\n\n## Options\n\nConfigure the logger by passing an options object:\n\n```js\nvar log = require('console-log-level')({\n  prefix: function (level) {\n    return new Date().toISOString()\n  },\n  level: 'info'\n})\n```\n\n### level\n\nA `string` to specify the log level. Defaults to `info`.\n\n### prefix\n\nSpecify this option if you want to set a prefix for all log messages.\nThis must be a `string` or a `function` that returns a string.\n\nWill get the level of the currently logged message as the first\nargument.\n\n### stderr\n\nA `boolean` to log everything to stderr. Defauls to `false`.\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":["Packages","包","Logging","目录"],"sub_categories":["Logging","日志"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Fconsole-log-level","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson%2Fconsole-log-level","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Fconsole-log-level/lists"}