{"id":15823233,"url":"https://github.com/oresoftware/bunion","last_synced_at":"2026-01-20T00:04:05.800Z","repository":{"id":57191596,"uuid":"130931859","full_name":"ORESoftware/bunion","owner":"ORESoftware","description":"Bunyan's weird cousin. Has foot issues.","archived":false,"fork":false,"pushed_at":"2024-04-17T22:35:18.000Z","size":340,"stargazers_count":1,"open_issues_count":33,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T08:48:02.482Z","etag":null,"topics":["json","logging","logs","nodejs","pipeline","pipelines"],"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/ORESoftware.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-25T01:10:09.000Z","updated_at":"2022-11-16T03:33:42.000Z","dependencies_parsed_at":"2024-10-26T13:28:30.617Z","dependency_job_id":"a45c2092-f25f-49c7-868e-8d860afc5b80","html_url":"https://github.com/ORESoftware/bunion","commit_stats":{"total_commits":308,"total_committers":6,"mean_commits":"51.333333333333336","dds":0.5844155844155844,"last_synced_commit":"43cfa00fa6739626130454f3ccc4b70626850c06"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fbunion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fbunion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fbunion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORESoftware%2Fbunion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ORESoftware","download_url":"https://codeload.github.com/ORESoftware/bunion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964866,"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":["json","logging","logs","nodejs","pipeline","pipelines"],"created_at":"2024-10-05T08:06:35.940Z","updated_at":"2026-01-20T00:04:05.773Z","avatar_url":"https://github.com/ORESoftware.png","language":"TypeScript","readme":"\n\u003cimg align=\"right\" width=\"20%\" height=\"20%\" src=\"https://raw.githubusercontent.com/oresoftware/bunion/master/media/bunion.png\"\u003e\n\n\u003cbr\u003e\n\n[![Version](https://img.shields.io/npm/v/bunion.svg?colorB=green)](https://www.npmjs.com/package/bunion)\n\n\u003cbr\u003e\n\n----\n\n# Bunion / BXN / B4N\n\n\u003e This logging module is ~30% more performant than Bunyan when used as a part of a complete pipeline.\n\n\u003e Advantages over other loggers like Bunyan\n\u003e 1. Has a default logger, configured by `.bunion.js`\n\u003e 2. Uses array format instead of object format by default - more readable and more performant\n\u003e 3. Has CLI tools for navigating log files\n\n\u003e Basic API\n\u003e 1. Only writes to stdout, not stderr\n\u003e 2. Uses an array format by default:\n\u003e\n\u003e```typescript\n\u003e  return safe.stringify([\n\u003e    '@bunion:1',  // the format of the logging line, with version number\n\u003e    appName,    // your app name\n\u003e    level,      // the logging level\n\u003e    process.pid,  // the process pid\n\u003e    host,         // the hostname where the log originated\n\u003e    new Date().toUTCString(),  // a UTC date string\n\u003e    fields,     // custom metadata - useful for filtering logs - fields is best used as an object {\"xyz\":\"foo\",\"filter\":\"on this\"}\n\u003e    message      // your message, which is an array\n\u003e  ]);\n\u003e \n\u003e```\n\u003e\n\n## \u003ci\u003e Installation \u003c/i\u003e\n\n```bash\n $ npm install bunion\n```\n\n## | Usage\n\n```typescript\n\nimport log from 'bunion';\nlog.info('just saying hi.');\nlog.warn('shit hit the fan', 'part 2');\nlog.debug('boop', {yep:'this property is on an object'}, {'we can log': {'nested':[\"objects, also\"]}});\n\n```\n\nthe above will log this raw data to stdout:\n\n```console\n[\"@bunion\",\"foobar\",\"INFO\",10613,\"host@you\",\"Sun, 25 Aug 2019 23:05:42 GMT\",null,[\"just saying hi.\"]]\n[\"@bunion\",\"foobar\",\"WARN\",10613,\"host@you\",\"Sun, 25 Aug 2019 23:05:42 GMT\",null,[\"shit hit the fan\",\"part 2\"]]\n[\"@bunion\",\"foobar\",\"DEBUG\",10613,\"host@you\",\"Sun, 25 Aug 2019 23:05:42 GMT\",null,[\"boop\",{\"yep\":\"this property is on an object\"},{\"we can log\":{\"nested\":[\"objects, also\"]}}]]\n\n```\n\n----\n\nand then you can read/consume the logs via:\n\n```bash\n\n $ node foo.js | bunion \n\n```\n\nUse the following env value for higher performance:\n\n```bash\n\n $ bunion_max_level=warn node foo.js | bunion --level warn\n\n```\n\n### Using the bunion config file to setup a default logger\n\n\u003e Use `.bunion.js` in the root of your project or current working directory.\n\n----\n\n\u003cdetails\u003e\n\u003csummary\u003eDefault logger configuration\u003c/summary\u003e\n\n```typescript\n\nconst getDefaultBunionConf = (): BunionConf =\u003e {\n  return {\n    producer: {\n      name: 'default',\n      appName: 'default',\n      forceRaw: false,\n      level: 'TRACE',\n      fields: {}\n    },\n    consumer: {\n      localeDateString: 'en-US',\n      highlightMatches: true,\n      level: 'TRACE',\n      match: [],\n      matchAny: [],\n      matchAll: [],\n      inspect: {\n        array: {\n          length: 25\n        },\n        object: {\n          depth: 5\n        }\n      },\n      transform: {\n        keys: {}\n      }\n    }\n  }\n};\n\n```\n\u003c/details\u003e\n\n\n### How it works:\n\n-----\n\n\u003cdetails\u003e\n\u003csummary\u003eExample 1\u003c/summary\u003e\n\nSomething like this:\n\n```bash\necho '{\"@bunion\":true,\"level\":\"WARN\",\"appName\":\"my-api\",\"date\":\"08-22-1984\",\"value\":\"this is the end\"}' | bunion\n\n```\n\nWill display this in your terminal:\n\n```console\n08-22-1984 app:my-api WARN  this is the end \n```\n\n\u003c/details\u003e\n\n----\n\n\u003cdetails\u003e\n\n\u003csummary\u003eExample 2\u003c/summary\u003e\n\nSomething like this:\n```bash\n echo '[\"@bunion\",\"app\",\"INFO\",333,\"host\",\"date-str\",null,\"message1\"]' | bunion\n\n```\n\nWill display this in your terminal:\n```console\ndate-str app:app INFO message1 \n```\n\u003c/details\u003e\n\n-----\n\n\u003cdetails\u003e\n\n\u003csummary\u003eExample 3\u003c/summary\u003e\n\nSomething like this:\n```bash\n echo '[\"@bunion\",\"app\",\"INFO\",333,\"host\",\"date-str\",null,[\"message1\",\"message2\",{\"foo\":\"bar\"}]]' | bunion\n\n```\n\nWill display this in your terminal:\n```console\ndate-str app:app INFO  message1 message2 {\n  foo: 'bar'\n} \n```\n\u003c/details\u003e\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foresoftware%2Fbunion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foresoftware%2Fbunion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foresoftware%2Fbunion/lists"}