{"id":21681763,"url":"https://github.com/cbschuld/lambda-tree","last_synced_at":"2026-05-11T03:45:17.575Z","repository":{"id":39745582,"uuid":"507166640","full_name":"cbschuld/lambda-tree","owner":"cbschuld","description":"Lambda Tree - a place for logs","archived":false,"fork":false,"pushed_at":"2022-11-19T19:28:39.000Z","size":136,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T09:46:11.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cbschuld.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}},"created_at":"2022-06-24T23:17:04.000Z","updated_at":"2023-03-09T01:32:33.000Z","dependencies_parsed_at":"2022-09-20T10:23:05.702Z","dependency_job_id":null,"html_url":"https://github.com/cbschuld/lambda-tree","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbschuld%2Flambda-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbschuld%2Flambda-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbschuld%2Flambda-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbschuld%2Flambda-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbschuld","download_url":"https://codeload.github.com/cbschuld/lambda-tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244600674,"owners_count":20479304,"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-11-25T15:31:18.622Z","updated_at":"2026-05-11T03:45:17.547Z","avatar_url":"https://github.com/cbschuld.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lambda Tree - a place for logs 🌳🪵\n\nA lightweight library designed to make AWS Lambda logs easier and well formed. Kill sloppy logs by using lambda-tree.\n\n## Motivation\n\nLambda debug can cause you to use more `console.log` calls than you want to admit. Admit it!! Eventually the logging gets messy. This library will help produce logs which are just easier to manage long term.\n\n## Installation\n\nThe recommended way to install the anticipated.io SDK is through `npm` or `Yarn`. The library is exposed as CommonJS and ESM.\n\nnpm:\n\n```sh\nnpm install lambda-tree\n```\n\nyarn:\n\n```sh\nyarn add lambda-tree\n```\n\n## Usage\n\nThe entire point of `lambda-tree` is simplicity with the goal of producing well-formed logs in JSON to AWS CloudWatch.\n\n#### Example Usage:\n\n```js\nconst log = new Log({ context })\nlog.info({ message: 'a simple log message' })\nlog.error({ error: 'oh no, bad' })\n```\n\n#### TypeScript example:\n\n```typescript\ninterface LogInfo {\n  user: string\n  company: string\n  operation: string\n}\n\nconst log = new Log\u003cLogInfo\u003e({ context })\nlog.info({ message: 'customer enabled', user, company, operation })\n```\n\n## Output\n\nExample output might be as follows:\n\n```json\n{\n  \"level\": \"info\",\n  \"requestId\": \"123\",\n  \"message\": \"user enabled\",\n  \"user\": { \"name\": \"John\", \"age\": 30, \"phone\": \"1234567890\" }\n}\n```\n\nWhich was produced via:\n\n```typescript\ninterface UserInfo {\n  name: string\n  age: number\n  phone: string\n}\n\nconst log = new Log\u003cUserInfo\u003e({ context })\nconst user: UserInfo = { name: 'John', age: 30, phone: '1234567890' }\nlog.info({ message: 'user enabled', ...user })\n```\n\n## Tagging\n\nThere is also a built-in system for tagging log entries. Methods `addTag` and `removeTag` are provided. A simple tagging might look like this:\n\n```js\nconst log = new Log({ context }).addTag('user')\nconst user = { username: 'bob' }\nlog.info({ message: 'user added', ...user })\n```\n\nwould produce the following:\n\n```json\n{ \"level\": \"info\", \"requestId\": \"123\", \"message\": \"user added\", \"username\": \"bob\", \"tags\": [\"user\"] }\n```\n\n## Tests\n\nTests are executed via Jest.\n\n```shell script\nnpm run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbschuld%2Flambda-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbschuld%2Flambda-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbschuld%2Flambda-tree/lists"}