{"id":16330845,"url":"https://github.com/amarcruz/react-native-android-log","last_synced_at":"2025-10-25T22:30:17.991Z","repository":{"id":57335248,"uuid":"134901684","full_name":"aMarCruz/react-native-android-log","owner":"aMarCruz","description":"Easy and useful log methods for Android apps in debug or release mode, with minimal impact.","archived":false,"fork":false,"pushed_at":"2022-09-01T01:58:15.000Z","size":66,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T10:51:15.336Z","etag":null,"topics":["android","debug","error","log","react-native"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/aMarCruz.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}},"created_at":"2018-05-25T20:26:58.000Z","updated_at":"2022-09-01T01:58:19.000Z","dependencies_parsed_at":"2022-08-29T21:11:27.009Z","dependency_job_id":null,"html_url":"https://github.com/aMarCruz/react-native-android-log","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Freact-native-android-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Freact-native-android-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Freact-native-android-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Freact-native-android-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aMarCruz","download_url":"https://codeload.github.com/aMarCruz/react-native-android-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238216885,"owners_count":19435610,"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":["android","debug","error","log","react-native"],"created_at":"2024-10-10T23:24:42.994Z","updated_at":"2025-10-25T22:30:17.628Z","avatar_url":"https://github.com/aMarCruz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-android-log\n\n[![npm][npm-image]](https://www.npmjs.com/package/react-native-android-log)\n[![License][license-image]](LICENSE)\n\nEasy and useful log methods for Android apps in debug or release mode, with minimal impact.\n\nIn my country (México), software developers are poorly paid, so I have had to look for another job to earn a living and I cannot dedicate more time to maintaining this and other repositories that over the years have never generated any money for me. If anyone is interested in maintaining this repository, I'd be happy to transfer it to them, along with the associated npm package. |\n:---: |\nEn mi país (México), los desarrolladores de software somos pésimamente pagados, por lo que he tenido que buscar otro trabajo para ganarme la vida y no puedo dedicar más tiempo a mantener éste y otros repositorios que a través de los años nunca me generaron dinero. Si a alguien le interesa dar mantenimiento a este repositorio, con gusto se lo transferiré, así como el paquete de npm asociado. |\n\nWorks with RN 0.50+, Gradle plugin 3.1.x and Gradle 4.4 or later.\n\nDefault build is for `minSdkVersion` 21 and `targetSdkVersion` 27, but you can [configure](#sdk-version-settings) this.\n\n**NOTE:**\n\nIn iOS, the default level is `SUPPRESS`, which disables the output. If you change it, `console.log` will be used.\n\n## Install\n\n1. Install the module from npm and link it:\n    ```bash\n    $ yarn add react-native-android-log\n    $ react-native link react-native-android-log\n    ```\n\n2. Replace 'compile' with 'implementation' in your android/app/build.gradle. It must looks like:\n    ```gradle\n    implementation project(':react-native-android-log')\n    ```\n\n#### For VS Code users\n\nOptional: You can add the tag used by Log to the `logCatArguments` properties in .vscode/launch.json\n\nThis example will include React Native warnings and errors, and all the messages from App in the \"OUTPUT\" panel:\n```json\n    ...\n    {\n      \"name\": \"Debug Android\",\n      \"program\": \"${workspaceRoot}/.vscode/launchReactNative.js\",\n      \"type\": \"reactnative\",\n      \"request\": \"launch\",\n      \"platform\": \"android\",\n      \"sourceMaps\": true,\n      \"outDir\": \"${workspaceRoot}/.vscode/.react\",\n      \"logCatArguments\": [\n        \"*:S\",\n        \"ReactNative:W\",\n        \"ReactNativeJS:W\",\n        \"App:V\"\n      ]\n    },\n```\n\n#### SDK version Settings\n\nOptional: In your android/build.gradle file, set the SDK versions that your app is using.\n\nExample with the predefined values:\n```groovy\next {\n    def buildToolsVersion  = '27.0.3'\n    def minSdkVersion      = 16\n    def compileSdkVersion  = 27\n    def targetSdkVersion   = 27\n}\n```\n\n## Usage\n\nLog messages in your JavaScript files:\n\n```js\nimport Log from 'react-native-android-log'\n\n// Set the default priority level (optional)\nLog.setLevel(__DEV__ ? Log.VERBOSE : Log.WARN)\n\n...\nLog.v('Verbose message')    // no output in release builds\nLog.w('Debugging')\n\n// debugging message with amother tag:\nLog.d('Proc2', 'warning')\n```\n\n...and see the output in the console through `adb`:\n\n```bash\n$ adb logcat -s App:V Proc2:V\n```\n\nor in the OUPUT panel of VS Code, if you are using the React Native Tools extension.\n\n## API\n\n### Contstants\n\nNumeric levels, from most to least verbosity:\n\nConstant | Description\n---------|------------\n`VERBOSE` | Used by `Log.v`, outputs nothing unless you use `Log.setLevel(Log.VERBOSE)`\n`DEBUG` | Priority constant for `Log.d`\n`INFO` | Priority constant for `Log.i`\n`WARN` | Priority constant for `Log.w`\n`ERROR` | Priority constant for `Log.e`\n`SUPPRESS` |  This is a special constant used to disable logging\n\n### Methods\n\n- `setTag(tag: string)`\n\n    Sets the tag to use by the logging methods without a tag parameter.\n\n    The predefined tag is \"App\".\n\n- `setLevel(tag: string | null, level: number)`\n\n    Allows you to change the logging level for a specific tag or, if you pass a null tag, the default level for all the tags.\n\n    The predefined level is `DEBUG` for debug builds and `ERROR` for release builds.\n\n- `getLevel(tag?: string | null)`\n\n    Return the level for a specific tag.\n\n    If tag is `null`, not specified, or does not have a specific level, this method return the default level for all the tags.\n\n- `print(level: string, tag: string, msg: string)`\n- `print(level: string, msg: string)`\n\n    Base method for all the one-letter logging methods.\n\n- `v (VERBOSE)`\n- `d (DEBUG)`\n- `i (INFO)`\n- `w (WARN)`\n- `e (ERROR)`\n\n    The above methods are one-letter shortcuts to the `print` method with the corresponding priority level and can be invoked with or without the `tag` parameter:\n\n    `method(tag: string, msg: string)`\n\n    `method(msg: string)`\n\n    If you omit the `tag`, the one specified with `setTag` will be used, or the predefined tag \"App\".\n\n### License\n\nMIT \u0026copy; 2018 Alberto Martínez\n\n[npm-image]:      https://img.shields.io/npm/v/react-native-android-log.svg\n[license-image]:  https://img.shields.io/npm/l/express.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarcruz%2Freact-native-android-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famarcruz%2Freact-native-android-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarcruz%2Freact-native-android-log/lists"}