{"id":18055733,"url":"https://github.com/marinerer/diy-log","last_synced_at":"2026-01-28T19:02:02.127Z","repository":{"id":57213189,"uuid":"161761497","full_name":"Marinerer/diy-log","owner":"Marinerer","description":"🌈 Various console log level prefixes with support for color symbols and tags. 📟 自定义控制台各种级别日志输出的前缀，支持颜色符号，标签和时间。","archived":false,"fork":false,"pushed_at":"2024-11-28T05:03:46.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T01:57:07.656Z","etag":null,"topics":["console","log","log-symbols","logger","logging","terminal"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/diy-log","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marinerer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2018-12-14T09:24:04.000Z","updated_at":"2024-11-28T05:03:35.000Z","dependencies_parsed_at":"2024-12-18T15:10:24.972Z","dependency_job_id":"4ead3e9a-c76d-4977-bc7f-ee3c0a9f62cf","html_url":"https://github.com/Marinerer/diy-log","commit_stats":null,"previous_names":["mengqing723/diy-log","marinerer/diy-log","meqn/diy-log"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Marinerer/diy-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fdiy-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fdiy-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fdiy-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fdiy-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marinerer","download_url":"https://codeload.github.com/Marinerer/diy-log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fdiy-log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28849360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","log","log-symbols","logger","logging","terminal"],"created_at":"2024-10-31T01:11:43.684Z","updated_at":"2026-01-28T19:02:02.110Z","avatar_url":"https://github.com/Marinerer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diy-log 🌈\n\n[![version](https://img.shields.io/npm/v/diy-log?style=flat-square)](https://www.npmjs.com/package/diy-log)\n[![Codecov](https://img.shields.io/codecov/c/github/Marinerer/diy-log?token=HYQ5I268HN\u0026style=flat-square\u0026logo=codecov)](https://codecov.io/gh/Marinerer/diy-log)\n[![release](https://img.shields.io/github/actions/workflow/status/Marinerer/diy-log/release.yml?style=flat-square)](https://github.com/Marinerer/pipflow/releases)\n[![node.js](https://img.shields.io/node/v/diy-log?style=flat-square\u0026logo=nodedotjs)](https://nodejs.org/en/about/releases/)\n[![languages](https://img.shields.io/github/languages/top/Marinerer/diy-log?style=flat-square)](https://github.com/Marinerer/diy-log)\n[![downloads](https://img.shields.io/npm/dm/diy-log?style=flat-square)](https://www.npmjs.com/package/diy-log)\n\n\n\n\u003e Various console log level prefixes with support for color symbols and tags.\n\n自定义控制台各种级别日志输出的前缀，支持颜色符号，标签和时间。\n\n\n![img](./example/screenshot.png)\n\n\n\n## Installation\n\n```bash\nnpm install diy-log --save-dev\n```\n\n\n\n## Usage\n\n```js\n// for cjs\nconst logger = require('diy-log')\nconst { log, symbols, colors, tag } = logger\n\n\n// for esm\nimport logger, {\n  log,\n  colors,\n  symbols,\n  tag\n} from 'diy-log'\n```\n\n```js\ntime('time ...')\n\ninfo('info ...')\ndone('done ...')\nerror('error ...')\nwarn('warn ...')\n\nlog(symbols.info, 'info ...')\nlog(symbols.done, 'done ...')\nlog(symbols.error, 'error ...')\nlog(symbols.warn, 'warn ...')\n\n\nlog(colors.dim('dim:text;'))\nlog(colors.blue('color: blue;'))\nlog(colors.bgGreen('bgcolor: green;'))\nlog(colors.bold('bold:text;'))\nlog(colors.italic('italic:text;'))\nlog(colors.underline('underline:text;'))\n\n\ntag('info message')\ntag('success message', 'done', 'success')\ntag.warn('warning message')\ntag.done('done message')\ntag.info(colors.blue('info message'))\ntag.error('error message')\n```\n\n## Methods\n\n```ts\ntype Log = (...args: any[]) =\u003e void\n\ntype TagType = (message: string, label?: string) =\u003e void\n\ninterface Tag {\n  (message: string, tag: 'info' | 'error' | 'done' | 'warn' = 'info', label?: string): void\n  info: TagType\n  error: TagType\n  done: TagType\n  warn: TagType\n}\n```\n\n- `log`: Log;\n- `time`: Log;\n- `info`: Log;\n- `error`: Log;\n- `done`: Log;\n- `warn`: Log;\n- `tag`: Tag;\n- `tag.info`: TagType;\n- `tag.error`: TagType;\n- `tag.done`: TagType;\n- `tag.warn`: TagType;\n\n\n## Thanks\n\n[log-symbols](https://github.com/sindresorhus/log-symbols) , [picocolors](https://github.com/alexeyraspopov/picocolors) , [time-stamp](https://github.com/jonschlinkert/time-stamp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinerer%2Fdiy-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarinerer%2Fdiy-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinerer%2Fdiy-log/lists"}