{"id":24106184,"url":"https://github.com/mikesparr/gcf-logger","last_synced_at":"2025-10-15T15:09:15.081Z","repository":{"id":57259853,"uuid":"148695711","full_name":"mikesparr/gcf-logger","owner":"mikesparr","description":"Reusable logger for Google Cloud Functions and more inspired by https://12factor.net/logs","archived":false,"fork":false,"pushed_at":"2018-11-29T21:56:22.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T08:20:31.604Z","etag":null,"topics":["12-factor","cloud-functions","environment-variables","logging"],"latest_commit_sha":null,"homepage":"","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/mikesparr.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-09-13T20:43:37.000Z","updated_at":"2018-11-29T21:56:23.000Z","dependencies_parsed_at":"2022-08-25T01:50:49.770Z","dependency_job_id":null,"html_url":"https://github.com/mikesparr/gcf-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikesparr/gcf-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesparr%2Fgcf-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesparr%2Fgcf-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesparr%2Fgcf-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesparr%2Fgcf-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikesparr","download_url":"https://codeload.github.com/mikesparr/gcf-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikesparr%2Fgcf-logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263803998,"owners_count":23514126,"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":["12-factor","cloud-functions","environment-variables","logging"],"created_at":"2025-01-10T21:18:09.458Z","updated_at":"2025-10-15T15:09:10.013Z","avatar_url":"https://github.com/mikesparr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GCF Logger\nThis is a reusable logger for Google Cloud Functions that includes a traceable ID\n\n# Installation\n```\nnpm install gcf-logger\nyarn add gcf-logger\n```\n\n# Usage\n## Node\n``` javascript\nconst logger = require(\"gcf-logger\");\n\n// instantiate: assume ENV var API_KEY exists\nconst log = new logger.Logger({\n    name: \"my-feature\",\n    level: 2\n});\n\n// using\nlog.info(`Something happened`);\n```\n\n## Typescript\n``` typescript\nimport {ILogger, Logger} from \"gcf-logger\";\n\n// instantiate: with just name\nconst log: ILogger = new Logger({\n    name: \"my-feature\"\n});\n\n// pass in reference (requestId) for traceability\nlog.init({requestId: 'http-12345'});\n\n// using\nlog.info(`Something happened`);\n```\n\n# Output\nThe output is sent to stdout as a stringified JSON object, making it easier to consume\nin document storage for later analysis.\n\n```\n{\n    ts: '2018-01-01T08:32:30.858Z', \n    msg: 'Something happened', \n    ref: 'http-12345', \n    type: 'info', \n    level: 2, \n    host: 'localhost', \n    pid: 12345\n}\n```\n\n# Testing\n```\nnpm test\nnpm run coverage\n```\n\n# Build (compiles Typescript to JS)\n```\nnpm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikesparr%2Fgcf-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikesparr%2Fgcf-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikesparr%2Fgcf-logger/lists"}