{"id":19594618,"url":"https://github.com/dbgate/pinomin","last_synced_at":"2025-04-27T15:34:10.952Z","repository":{"id":65540925,"uuid":"594338219","full_name":"dbgate/pinomin","owner":"dbgate","description":"Minimalistic logger compatible with pino","archived":false,"fork":false,"pushed_at":"2024-05-27T15:59:25.000Z","size":82,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T05:19:37.276Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbgate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-28T08:21:05.000Z","updated_at":"2024-10-23T12:04:25.000Z","dependencies_parsed_at":"2023-02-15T15:15:23.424Z","dependency_job_id":null,"html_url":"https://github.com/dbgate/pinomin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbgate%2Fpinomin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbgate%2Fpinomin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbgate%2Fpinomin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbgate%2Fpinomin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbgate","download_url":"https://codeload.github.com/dbgate/pinomin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251162863,"owners_count":21545835,"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-11T08:44:18.467Z","updated_at":"2025-04-27T15:34:05.938Z","avatar_url":"https://github.com/dbgate.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pinomin\n\nMinimalistic JSON logger compatible with [pino](https://www.npmjs.com/package/pino) logger. Pino uses lot of optimalizations to be super fast. Sometimes, these optimalizations could cause problems and you need only to create few simple logs. pinomin is naive logger implemented in one file, thanks to compatibility, you could upgrade to pino, if you need better performance.\n\n## Install\n\nUsing NPM:\n\n```\n$ npm install pinomin\n```\n\nUsing YARN:\n\n```\n$ yarn add pinomin\n```\n\n## Usage\n\n```js\nconst { createLogger } = require('pinomin');\n\nconst logger = createLogger();\n\nlogger.info('hello world');\n\nconst child = logger.child({ a: 'property' });\nchild.info('hello child!');\n```\n\nThis produces:\n\n```\n{\"level\":30,\"time\":1531171074631,\"msg\":\"hello world\"}\n{\"level\":30,\"time\":1531171082399,\"msg\":\"hello child!\",\"a\":\"property\"}\n```\n\n## Configure logger\nConfiguration is different from pino, you could define multiple targets by default.\n\n```js\nconst logger = createLogger({\n  base: { pid: process.pid },\n  targets: [\n    {\n      type: 'console',\n      level: process.env.CONSOLE_LOG_LEVEL || process.env.LOG_LEVEL || 'info',\n    },\n    {\n      type: 'stream',\n      level: process.env.FILE_LOG_LEVEL || process.env.LOG_LEVEL || 'info',\n      stream: fs.createWriteStream('/etc/logs/mylogs.txt', { flags: 'a' }),\n    },\n  ],\n});\n```\n\n- There are two types of target available\n  - `console` outputs JSON log messages to console with console.log\n  - `stream` writes JSON log messages to `stream` property\n- `base` property defines base object to be merged into produced JSON log messages\n\n\n### Development Formatting\n\npinomin uses the same format as pino logger, so [`pino-pretty`](https://github.com/pinojs/pino-pretty) module could be used for producing nice log outpus during development.\n\n![pretty demo](https://raw.githubusercontent.com/pinojs/pino/master/pretty-demo.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbgate%2Fpinomin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbgate%2Fpinomin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbgate%2Fpinomin/lists"}