{"id":21533284,"url":"https://github.com/alinz/react-native-logger","last_synced_at":"2025-04-10T00:43:27.468Z","repository":{"id":57338152,"uuid":"50127063","full_name":"alinz/react-native-logger","owner":"alinz","description":"Async aware logger for react-native with grouping and filter feature","archived":false,"fork":false,"pushed_at":"2017-04-15T21:42:55.000Z","size":4603,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T00:43:22.963Z","etag":null,"topics":["async","filter","grouping","logger","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/alinz.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":"2016-01-21T18:15:30.000Z","updated_at":"2021-10-08T09:30:16.000Z","dependencies_parsed_at":"2022-09-12T11:10:13.092Z","dependency_job_id":null,"html_url":"https://github.com/alinz/react-native-logger","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alinz%2Freact-native-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alinz","download_url":"https://codeload.github.com/alinz/react-native-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137998,"owners_count":21053775,"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":["async","filter","grouping","logger","react-native"],"created_at":"2024-11-24T02:27:53.575Z","updated_at":"2025-04-10T00:43:27.441Z","avatar_url":"https://github.com/alinz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Native-Logger\n\nSync or Async Aware logger for react-native\n\nThis Project address couple of issues\n\n- Simple to use\n- Group logs\n- Filter Logs by name\n- Async aware\n\n### Installation (NPM or Yarn)\n\n```bash\nnpm install react-native-logger --save\n```\n\n```bash\nyarn add react-native-logger\n```\n\n### Usage\n\n```js\nimport { logger } from 'react-native-logger'\n```\n\nThere are 3 functions.\n\n#### log: (...args: Array\u003cany\u003e) =\u003e void\n\nsimilar to `console.log`. for example \n\n``` js\nlogger.log('this is awesome', 10, 10)\n\n// logs as\n// this is awesome 10 10\n```\n\n#### group: (name: string, title: string, log: LogFn) =\u003e void\n\nit accepts 3 arguments. `name` is an identifier which you can use in `setFilters`. `title` is a simple description about the log it self. and `log` is a function which your loggin happening. The signiture of LogFn is \n\n```js\ntype LogFn: (log: (...args: Array\u003cany\u003e) =\u003e void) =\u003e void | Promise\u003cany\u003e\n```\n\nIt basically group related logs into one. also you can return a promise which cause the logs waits until you tell it so.\n\n```js\nlogger.group('api', 'loads users list', async (log) =\u003e {\n  \n  const users = await apis.getAllUsers();\n\n  log('list of users', users);\n\n  actions.updateUsersList(users);\n});\n```\n\n#### setFilters: (...names: Array\u003cstring\u003e): void\n\nsimply filters out everything except those names that you pass to logs. to clear the filter simply call it without arguments.\n\n```js\nlogger.filters('api')\n```\n\ncheers,\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinz%2Freact-native-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falinz%2Freact-native-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinz%2Freact-native-logger/lists"}