{"id":50979511,"url":"https://github.com/jayemscript/pretty-log-tagged","last_synced_at":"2026-06-19T12:34:18.751Z","repository":{"id":354342725,"uuid":"1223210719","full_name":"jayemscript/pretty-log-tagged","owner":"jayemscript","description":"Make console logs readable with clean, structured, tag-based output.","archived":false,"fork":false,"pushed_at":"2026-04-28T08:21:43.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T08:24:35.992Z","etag":null,"topics":["console","console-log","javascript","logging","nodejs","npm-package","pretty-print","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pretty-log-tagged","language":"TypeScript","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/jayemscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T05:32:31.000Z","updated_at":"2026-04-28T08:21:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jayemscript/pretty-log-tagged","commit_stats":null,"previous_names":["jayemscript/pretty-log"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/jayemscript/pretty-log-tagged","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayemscript%2Fpretty-log-tagged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayemscript%2Fpretty-log-tagged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayemscript%2Fpretty-log-tagged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayemscript%2Fpretty-log-tagged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jayemscript","download_url":"https://codeload.github.com/jayemscript/pretty-log-tagged/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jayemscript%2Fpretty-log-tagged/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34532256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","console-log","javascript","logging","nodejs","npm-package","pretty-print","typescript"],"created_at":"2026-06-19T12:34:18.031Z","updated_at":"2026-06-19T12:34:18.741Z","avatar_url":"https://github.com/jayemscript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pretty-log-tagged\n\nMake console logs readable with clean, structured, tag-based output.\n\n[![npm version](https://img.shields.io/npm/v/pretty-log-tagged)](https://www.npmjs.com/package/pretty-log-tagged)\n[![npm downloads](https://img.shields.io/npm/dm/pretty-log-tagged)](https://www.npmjs.com/package/pretty-log-tagged)\n[![license](https://img.shields.io/npm/l/pretty-log-tagged)](./LICENSE)\n\n## The Problem\n\n```ts\nconsole.log(`User login: ${JSON.stringify(user)}`);\nconsole.log(`[PAYMENT] ${JSON.stringify(payload)}`);\nconsole.log(`[DB] Query took ${ms}ms`);\n```\n\nHard to scan. No structure. No color. Every log looks the same.\n\n## The Solution\n\n```ts\nclog.user(user);\nclog.payment(payload);\nclog.db(`Query took ${ms}ms`);\n```\n\nEach log line gets a colored tag, a timestamp, and formatted output automatically.\n\n## Installation\n\n```bash\nnpm install pretty-log-tagged\n```\n\n## Usage\n\n```ts\nimport { clog } from 'pretty-log-tagged';\n\nclog.user({ id: 1, name: 'Jay' });\nclog.error('Something went wrong');\nclog.payment({ amount: 99.99, currency: 'USD' });\nclog.server('Listening on port 3000');\nclog.db({ query: 'SELECT *', table: 'users' });\nclog.auth({ token: 'Bearer ...' });\n```\n\nThe dot notation is the tag. Any property you access becomes the label of that log line. All built-in tags are pre-styled, and any unknown tag falls back to a default style automatically.\n\n```ts\nclog.anything('works too');\nclog.myCustomTag({ whatever: true });\n```\n\n## Built-in Tags\n\n| Tag        | Console Method |\n|------------|----------------|\n| `info`     | console.info   |\n| `success`  | console.log    |\n| `warn`     | console.warn   |\n| `error`    | console.error  |\n| `debug`    | console.debug  |\n| `user`     | console.log    |\n| `auth`     | console.log    |\n| `db`       | console.log    |\n| `api`      | console.log    |\n| `server`   | console.log    |\n| `request`  | console.log    |\n| `response` | console.log    |\n| `cache`    | console.log    |\n| `job`      | console.log    |\n| `event`    | console.log    |\n| `mail`     | console.log    |\n| `payment`  | console.log    |\n| `socket`   | console.log    |\n| `test`     | console.log    |\n\n## Custom Logger\n\nNeed your own tags or want to silence logs in tests? Use `createLogger`:\n\n```ts\nimport { createLogger } from 'pretty-log-tagged';\n\nconst log = createLogger({\n  timestamp: true,   // show ISO timestamp, default: true\n  silent: false,     // suppress all output, default: false\n  tags: {\n    stripe: { fg: 'black', bg: 'brightGreen', level: 'log' },\n    redis:  { fg: 'white', bg: 'red',         level: 'warn' },\n  },\n});\n\nlog.stripe({ event: 'charge.succeeded' });\nlog.redis('Cache miss');\n```\n\nSilence all output in test environments:\n\n```ts\nconst log = createLogger({ silent: process.env.NODE_ENV === 'test' });\n```\n\n## Options\n\n| Option      | Type      | Default | Description                       |\n|-------------|-----------|---------|-----------------------------------|\n| `timestamp` | `boolean` | `true`  | Prepend ISO timestamp to each log |\n| `silent`    | `boolean` | `false` | Suppress all output               |\n| `tags`      | `object`  | `{}`    | Add or override tag definitions   |\n\n## Tag Config\n\nEach entry in `tags` accepts:\n\n```ts\n{\n  fg: FgColor,     // foreground color\n  bg: BgColor,     // background color\n  level: 'log' | 'info' | 'warn' | 'error' | 'debug'\n}\n```\n\nAvailable colors: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `gray`, and their `bright` variants — `brightRed`, `brightGreen`, `brightBlue`, etc.\n\n## TypeScript\n\nFully typed. The default `clog` instance and any instance from `createLogger` are typed with all built-in tags. Custom tags are accessible via string indexing.\n\n```ts\nimport { clog, createLogger, PrettyLogger, LoggerOptions } from 'pretty-log-tagged';\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayemscript%2Fpretty-log-tagged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjayemscript%2Fpretty-log-tagged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjayemscript%2Fpretty-log-tagged/lists"}