{"id":16736255,"url":"https://github.com/flexdinesh/babel-plugin-render-logger","last_synced_at":"2025-04-10T12:21:31.250Z","repository":{"id":51667917,"uuid":"222819882","full_name":"flexdinesh/babel-plugin-render-logger","owner":"flexdinesh","description":"⚙️ Babel plugin that automatically adds a console statement to React components and makes debugging easier","archived":false,"fork":false,"pushed_at":"2021-05-11T07:46:29.000Z","size":599,"stargazers_count":7,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:08:14.352Z","etag":null,"topics":["babel","babel-plugin","debugging-tool","developer-tools","reactjs"],"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/flexdinesh.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":"2019-11-20T00:56:44.000Z","updated_at":"2021-05-28T16:38:15.000Z","dependencies_parsed_at":"2022-08-22T03:40:16.549Z","dependency_job_id":null,"html_url":"https://github.com/flexdinesh/babel-plugin-render-logger","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/flexdinesh%2Fbabel-plugin-render-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Fbabel-plugin-render-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Fbabel-plugin-render-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexdinesh%2Fbabel-plugin-render-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexdinesh","download_url":"https://codeload.github.com/flexdinesh/babel-plugin-render-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217130,"owners_count":21066633,"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":["babel","babel-plugin","debugging-tool","developer-tools","reactjs"],"created_at":"2024-10-13T00:08:50.015Z","updated_at":"2025-04-10T12:21:31.234Z","avatar_url":"https://github.com/flexdinesh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-render-logger\n\nBabel plugin that automatically adds a console statement to React components and makes debugging easier.\n\n## Install\n\n_NOTE: This package is not published to npm yet_\n\n```sh\nyarn add --dev babel-plugin-render-logger\n```\n\n## Example\n\nTransforms\n\n```jsx\nconst HelloWorld = () =\u003e {\n  return \u003cspan\u003eHello World\u003c/span\u003e;\n};\n\nclass HelloWorld extends React.Component {\n  render() {\n    return \u003cspan\u003eHello World\u003c/span\u003e;\n  }\n}\n```\n\nto\n\n```jsx\nconst HelloWorld = () =\u003e {\n  console.log('\u003e\u003e RenderLog \u003e\u003e', 'HelloWorld');\n  return \u003cspan\u003eHello World\u003c/span\u003e;\n};\n\nclass HelloWorld extends React.Component {\n  render() {\n    console.log('\u003e\u003e RenderLog \u003e\u003e', 'HelloWorld');\n    return \u003cspan\u003eHello World\u003c/span\u003e;\n  }\n}\n```\n\n## Usage\n\n`.babelrc`\n\nUse the logger only in `development`.\n\n```json\n{\n  \"presets\": [\"react-app\"],\n  \"env\": {\n    \"development\": {\n      \"plugins\": [\"render-logger\"]\n    }\n  }\n}\n```\n\n### Config\n\n#### name\n\nAll components will log by default. You can pass in the component name as a string or regex and only components that match the name will be logged.\n\nLog all components matching the name \"Hello\"\n\n```json\n{\n  \"plugins\": [\n    [\"render-logger\", {\n      \"name\": \"Hello\"\n    }]\n  ]\n}\n```\n\nLog all components matching the name \"Hello\" or \"Welcome\"\n\n```json\n{\n  \"plugins\": [\n    [\"render-logger\", {\n      \"name\": \"Hello|Welcome\"\n    }]\n  ]\n}\n```\n\n#### disableConsoleStyles\n\nDisable the styles in console statements. To differentiate the log noise, the console statements are colored by default.\n\n```json\n{\n  \"plugins\": [\n    [\"render-logger\", {\n      \"name\": \"Hello|Welcome\",\n      \"disableConsoleStyles\": true\n    }]\n  ]\n}\n```\n\n#### consoleMethod\n\nDefault console method is `info` (`console.info()`). You can choose to use a different method. Accepts `warn`, `error`, `trace`, `info` and `log`;\n\n```json\n{\n  \"plugins\": [\n    [\"render-logger\", {\n      \"name\": \"Hello|Welcome\",\n      \"disableConsoleStyles\": true,\n      \"consoleMethod\": \"warn\"\n    }]\n  ]\n}\n```\n\n## License\n\nMIT © Dinesh Pandiyan\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexdinesh%2Fbabel-plugin-render-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexdinesh%2Fbabel-plugin-render-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexdinesh%2Fbabel-plugin-render-logger/lists"}