{"id":16184032,"url":"https://github.com/fralonra/fastify-log","last_synced_at":"2025-03-19T02:31:01.751Z","repository":{"id":57233315,"uuid":"127011353","full_name":"fralonra/fastify-log","owner":"fralonra","description":"Colorful terminal logger for Fastify.","archived":false,"fork":false,"pushed_at":"2022-08-08T04:31:53.000Z","size":87,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T09:03:23.602Z","etag":null,"topics":["fastify","fastify-plugin","logger"],"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/fralonra.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":"2018-03-27T15:53:25.000Z","updated_at":"2024-01-24T17:55:14.000Z","dependencies_parsed_at":"2022-08-31T20:51:16.681Z","dependency_job_id":null,"html_url":"https://github.com/fralonra/fastify-log","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Ffastify-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Ffastify-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Ffastify-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fralonra%2Ffastify-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fralonra","download_url":"https://codeload.github.com/fralonra/fastify-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243851783,"owners_count":20358258,"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":["fastify","fastify-plugin","logger"],"created_at":"2024-10-10T07:08:46.959Z","updated_at":"2025-03-19T02:31:01.444Z","avatar_url":"https://github.com/fralonra.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-log\n\n[![Build Status](https://travis-ci.com/fralonra/fastify-log.svg?branch=master)](https://travis-ci.com/fralonra/fastify-log)\n[![npm version](https://img.shields.io/npm/v/fastify-log.svg)](https://www.npmjs.com/package/fastify-log) [![Greenkeeper badge](https://badges.greenkeeper.io/fralonra/fastify-log.svg)](https://greenkeeper.io/)\n\nA terminal logger plugin for [Fastify](fastify.io).\n\n## Features\n\n* Displays time.\n* Colorful outputs.\n* Debug level support.\n\n## Install\n\n```bash\nnpm install fastify-log\n```\n\n## Usage\n\n```javascript\nconst fastify = require('fastify')();\nfastify.register(require('fastify-log')); // Or fastify.register(require('fastify-log'), { options } );\n\nconst port = 3000;\nfastify.listen(port, (err) =\u003e {\n  if (err) fastify.error(err);\n  fastify.warn('this is a waring text');\n  // Pass in multiple arguments\n  fastify.info('server listening on', port);\n});\n```\n\nThe above code will output the following in your console, where the time is your system's current time:\n\n![ScreenShot](/screenshot.png)\n\n### API\n\n#### options\n\n| Option | Description | Type | Default |\n| --- | --- | --- | --- |\n| allInOne | If true, you should use `fastify.logger.info/warn/error` instead of `fastify.info/warn/error`. | Boolean | false |\n| time | If false, current time will not show. | Boolean | true |\n| timeFormat | Display format for the time. | String | 'HH:mm:ss' |\n| level | Determine debug level. If level \u003e 1, info hides. If level \u003e 2, only error shows. If level \u003e 3, all hide. | Number | 1 |\n| info | Color for info messages. | String | '#ffffff' |\n| warn | Color for warning messages. | String | '#ffa500' |\n| error | Color for error messages. | String | '#dc143c' |\n\n```javascript\nconst fastify = require('fastify')();\nfastify.register(require('fastify-log'), { options } );\n```\n\n### Alternative\n\n`fastify-log` is quite a simple plugin, and here is a list of other tools you can turn to:\n* [pino-colada](https://github.com/lrlna/pino-colada/)\n\n### License\n\n[MIT](https://github.com/fralonra/fastify-log/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffralonra%2Ffastify-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffralonra%2Ffastify-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffralonra%2Ffastify-log/lists"}