{"id":18823030,"url":"https://github.com/himynameisdave/loggit","last_synced_at":"2025-08-05T12:08:00.875Z","repository":{"id":26095866,"uuid":"29539944","full_name":"himynameisdave/loggit","owner":"himynameisdave","description":"🌲 A simple and beautiful logging utility for NodeJS.","archived":false,"fork":false,"pushed_at":"2023-01-06T16:56:23.000Z","size":2269,"stargazers_count":1,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-02T13:51:55.238Z","etag":null,"topics":["console-log","logger","logging","logging-library","loggit","node-logger"],"latest_commit_sha":null,"homepage":"","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/himynameisdave.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":"2015-01-20T16:41:16.000Z","updated_at":"2021-02-01T02:08:17.000Z","dependencies_parsed_at":"2023-01-14T04:01:35.943Z","dependency_job_id":null,"html_url":"https://github.com/himynameisdave/loggit","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/himynameisdave/loggit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himynameisdave%2Floggit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himynameisdave%2Floggit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himynameisdave%2Floggit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himynameisdave%2Floggit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himynameisdave","download_url":"https://codeload.github.com/himynameisdave/loggit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himynameisdave%2Floggit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268893835,"owners_count":24324762,"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","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"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-log","logger","logging","logging-library","loggit","node-logger"],"created_at":"2024-11-08T00:52:26.491Z","updated_at":"2025-08-05T12:08:00.827Z","avatar_url":"https://github.com/himynameisdave.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" margin=\"0 auto 20px\"\u003e\n  \u003ch1\u003eloggit\u003c/h1\u003e\n  \u003cp style=\"font-style: italic;\"\u003e🌲 A simple and beautiful logging utility for NodeJS.\u003c/p\u003e\n  \u003cdiv\u003e\n    \u003ca href='https://github.com/himynameisdave/loggit/actions?query=workflow%3Atest+branch%3Amain'\u003e\n      \u003cimg src=\"https://github.com/himynameisdave/loggit/workflows/test/badge.svg\" alt=\"GitHub Actions - Test Workflow Badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href='https://coveralls.io/github/himynameisdave/loggit?branch=main'\u003e\n      \u003cimg src='https://coveralls.io/repos/github/himynameisdave/loggit/badge.svg?branch=main' alt='Coverage Status' /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://app.fossa.com/projects/git%2Bgithub.com%2Fhimynameisdave%2Floggit?ref=badge_shield\"\u003e\n      \u003cimg src=\"https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhimynameisdave%2Floggit.svg?type=shield\" alt=\"FOSSA Status\" /\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n\n---\n\n`loggit` is a simple yet robust logger utility for NodeJS. To a degree, it is a wrapper around [`chalk`](https://www.npmjs.com/package/chalk) + `console.log`, so that I don't need to install `chalk` in every project and to standardize the way I do logging in various projects.\n\n## Install\n\nYou can install it with NPM or Yarn:\n\n```bash\nyarn add loggit\n\nnpm install loggit\n```\n\n## Usage\n\n`loggit` exposes two modules:\n\n- `log` - A very simple logger function.\n- `createLogger` - Returns a customized logger function.\n\n### `log`\n\nProvide `log` with a message string, as well as an optional color (of type [`chalk.ForegroundColor`](https://github.com/chalk/chalk/blob/02abeebac3fa41b346ad1f0b4674d371953da932/index.d.ts#L6)), and it will be logged to the console.\n\n```typescript\nimport { log } from 'loggit';\n\n\nlog('hello world');\n\nlog('some error', 'red');\n```\n\nArgument | Type | Default\n---|---|---\n`message` | `string` | -\n`color` | `chalk.ForegroundColor` | `'whiteBright'`\n\n### `createLogger`\n\n`createLogger` allows you to create loggers for various different \"tasks\" in your app/script. It is more akin to something like [`winston`](https://github.com/winstonjs/winston) than a regular `console.log`, in that it will log a timestamp and make your \"task\" very visible using a [`chalk.BackGroundColor`](https://github.com/chalk/chalk/blob/02abeebac3fa41b346ad1f0b4674d371953da932/index.d.ts#L31).\n\n```typescript\nimport { createLogger } from 'loggit';\n\n//  Create a simple logger with default options\nconst logInfo = createLogger('info');\n//  Create a success logger, where the \"task\" will be logged with a green BG.\nconst logSuccess = createLogger('success', {\n  taskColor: 'bgGreen',\n});\n//  Create an error logger, where the \"task\" will be red and the timestamp will be bright magenta.\nconst logError = createLogger('error', {\n  taskColor: 'bgRed',\n  timestampColor: 'redBright',\n});\n\n//  Use the loggers\nlogInfo('Started the app');\n\nlogSuccess('Things are going well');\n\nlogError('Uh oh, something went wrong');\n\n```\n\nThis example would write the following to the console:\n\n![An example of createLogger module, displaying three items logged to the console](https://user-images.githubusercontent.com/4298089/101206163-95ce1b80-3623-11eb-8d53-044c37a0de6c.png)\n\nArgument | Type | Default\n---|---|---\n`task` | `string` | -\n`config` | `CreateLoggerConfig` | See below.\n`config.taskColor` | `chalk.BackgroundColor` | `'bgCyanBright'`\n`config.timestampColor` | `chalk.ForegroundColor` | `'cyanBright'`\n\nNote that `createLogger` returns the `log` function, meaning that you can also customize the message color when using your custom logger.\n\n```typescript\nimport { createLogger } from 'loggit';\n\nconst logInfo = createLogger('info');\n\nlogInfo('I will be yellow!', 'yellow');\n```\n\n## Contributing\n\nIf you have ideas or suggestions on how to improve this package, feel free to file an issue or better yet open a pull request! Please follow the existing code style (enforced by ESLint anyway), and please add/alter unit tests for any new or changed functionality.\n\n## License\n\nLicensed under MIT.\n\n---\n\n_✌️ Made by [Dave](https://himynameisdave.com)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimynameisdave%2Floggit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimynameisdave%2Floggit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimynameisdave%2Floggit/lists"}