{"id":24912517,"url":"https://github.com/skoshx/logpile","last_synced_at":"2025-03-28T04:19:01.760Z","repository":{"id":57679714,"uuid":"492325577","full_name":"skoshx/logpile","owner":"skoshx","description":"🪵 A simple \u0026 tiny logging library with supercharged search features","archived":false,"fork":false,"pushed_at":"2022-05-18T12:12:20.000Z","size":109,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T20:39:33.467Z","etag":null,"topics":["extendable","logger","logging","search","simple","tiny","typescript","utility"],"latest_commit_sha":null,"homepage":"https://paka.dev/npm/logpile","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/skoshx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-14T21:08:00.000Z","updated_at":"2022-07-31T13:18:23.000Z","dependencies_parsed_at":"2022-09-14T11:52:24.076Z","dependency_job_id":null,"html_url":"https://github.com/skoshx/logpile","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoshx%2Flogpile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoshx%2Flogpile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoshx%2Flogpile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skoshx%2Flogpile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skoshx","download_url":"https://codeload.github.com/skoshx/logpile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245868294,"owners_count":20685607,"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":["extendable","logger","logging","search","simple","tiny","typescript","utility"],"created_at":"2025-02-02T05:20:12.413Z","updated_at":"2025-03-28T04:19:01.740Z","avatar_url":"https://github.com/skoshx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/logpile-logo.png\" /\u003e\n\u003c/p\u003e\n\n\u003e 🪵 A simple \u0026 tiny logging library with supercharged search features\n\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/skoshx/logpile/blob/main/LICENSE.md)\n[![CI](https://github.com/skoshx/logpile/actions/workflows/ci.yml/badge.svg)](https://github.com/skoshx/logpile/actions/workflows/ci.yml)\n[![prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/skoshx/logpile/blob/main/README.md)\n[![Docs](https://paka.dev/badges/v0/cute.svg)](https://paka.dev/npm/logpile)\n\nLogs are an integral part of building good software, especially APIs. It's important for logs to be easy to write in code, and easy to connect to some larger entity. This is where `logpile` comes in. This library is perfect for needing a versatile logger that works for anything, and that can flexibly search logs.\n\nA perfect example is an API, where errors are logged with a reference to the users account. You can use `logpile` to search for all the error logs associated with that user, and display them to the API user.\n\n## Install\n\n```bash\n$ yarn add logpile\n```\n\nor with npm\n\n```bash\n$ npm install --save logpile\n```\n\n## Features\n\n- Tiny, Simple \u0026 Extendable\n- Extendable output medium (stdout, file, database or custom)\n- Supercharged search features (text, object, fuzzy)\n- Hides sensitive values from the logs\n- Fully TypeScript\n\n## Usage\n\n```typescript\nimport { createLogger } from 'logpile';\n\nconst logger = createLogger({\n  persist: [consolePersist({ level: 'error' }), filePersist()],\n  retrieve: fileRetrieve(),\n});\n\n// you can pass anything to the function\nlogger.warn('hello world', { some: 'object' }, 'another message');\n/*=\u003e {\n  timestamp: \"2022-05-13T01:19:18.402Z\",\n  level: \"warning\",\n  message: \"hello world\",\n  message2: \"another message\",\n  some: \"object\"\n}*/\n\n// you can search all logs with useful features\n// search logs containing value 'hello world', in the last hour\n\n/**\n * You can search all logs with useful features.\n * Search logs containing value 'hello world', from the last hour\n */\nconst logs = logger.searchLogs('hello world', { time: '1h' });\n```\n\n## License\n\n`logpile` is released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## TODO\n\n- Improved search functionality\n  - Search options for time (vercel's `ms` type eg. { time: '1wk' })\n  - Search where timestamp between 2 values\n  - Search items can be ranges (eg. { count \u003e 2 \u0026\u0026 count \u003c 4 })\n- Deno release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoshx%2Flogpile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskoshx%2Flogpile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskoshx%2Flogpile/lists"}