{"id":20962991,"url":"https://github.com/doesdev/bock","last_synced_at":"2025-03-13T07:23:04.079Z","repository":{"id":66222217,"uuid":"84510271","full_name":"doesdev/bock","owner":"doesdev","description":"Bock is a strong lager (logger) of German (US) origin","archived":false,"fork":false,"pushed_at":"2021-09-22T16:47:17.000Z","size":103,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-20T03:17:12.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/doesdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2017-03-10T02:25:06.000Z","updated_at":"2023-03-08T04:46:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"81fae507-5eec-45f7-aa42-cd5478729812","html_url":"https://github.com/doesdev/bock","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":0.09999999999999998,"last_synced_commit":"65d84d0d04ac523d14e4984abf8fcd40947256ef"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fbock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fbock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fbock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fbock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doesdev","download_url":"https://codeload.github.com/doesdev/bock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243359620,"owners_count":20278231,"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-19T02:39:46.207Z","updated_at":"2025-03-13T07:23:04.059Z","avatar_url":"https://github.com/doesdev.png","language":"JavaScript","readme":"# bock [![NPM version](https://badge.fury.io/js/bock.svg)](https://npmjs.org/package/bock)   [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)   [![Build Status](https://travis-ci.com/doesdev/bock.svg)](https://travis-ci.com/doesdev/bock)\n\n\u003e Bock is a strong ~~lager~~ logger of ~~German~~ US origin\n\n## install\n\n```sh\n$ npm install --save bock\n```\n\n## usage\n\n```js\nconst options = { appName: 'myAwesomeApp', logLevel: 'warn', toFile: true }\nconst bock = require('bock')(options)\nbock.fatal(new Error('something went wrong'))\n```\n\n## api\n\nBock exports a primary function which returns an instance with methods\n(`debug`, `info`, `warn`, `fatal`, `setLogLevel`, `close`)\n- **options** *(Object - optional)*\n  - **appName** *(String - optional - default: 'bock')* Base name to use for log files (`${appName}-${month}-${day}-${year}.json`)\n  - **logBase** *(String - optional - default: `__dirname + '/logs'`)* Path for log files\n  - **logLevel** *(String - optional - default: 'debug')* Threshold for logging (i.e. if warn it won't log debug or info errors)\n  - **newline** *(Boolean - optional - default: `true`)* Use newline delimited JSON (highly recommended for performance reasons)\n  - **toConsole** *(Boolean - optional - default: true)* Should log to console\n  - **toFile** *(Boolean - optional - default: true)* Should log to file\n  - **whitelist** *(Array - optional)* List of ignored error types / messages\n  - **track** *(Boolean - optional - default: false)* Should log methods return\n  a `Promise` indicating the log was written\n\nEach of the four methods (`debug`, `info`, `warn`, `fatal`) accept an `Error`\nobject, a string, or a function that returns one of those two things. They also\naccept a second argument (`transform`) which is a function that will accept as\nits only argument the final text output to file and/or console, and what it\nreturns will the text value to be logged. This is primarily useful for\ncleansing sensitive information from the output.\n\nWhere `const logger = bock([opts])` (i.e. on an instance) the following methods\nare also available\n\n`logger.setLogLevel(string logLevel)` Changes logLevel setting on instance\n\n`logger.close()` Close forked process used for file writing\n\nAdditionally, you can choose to use the `bock.cached([opts])` which will return\nthe last instance instantiated using the `cached` method or create a new one\nwith the passed opts (and cache it).\n\n## license\n\nMIT © [Andrew Carpenter](https://github.com/doesdev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fbock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoesdev%2Fbock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fbock/lists"}