Skip to content

Provide a way to disable React-Native console.log #308

@Andarius

Description

@Andarius

Introduction

When running in release mode, React-native will display info logs (as also mentioned in this issue: facebook/react-native#18584 and in this PR: facebook/react-native#30579 )

Details

For instance, using react-native-navigation, the following logs are displayed (because of Libraries/ReactNative/AppRegistry.js:186):

Running "main.Session" with {"initialProps":{"componentId":"Component1"},"rootTag":1301}

Causing them to appear in report logs like Bugsnag:

Capture d’écran 2020-12-13 à 10 28 43

Discussion points

Since it seems accepted that the default behavior is that React Native is logging data via console.log and the recommended way to deal with it is to install a third-party package, I would like to propose the idea of setting a flag to be able to disable it.

Something like AppRegistry.disableLogs seems like a reasonable approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🗣 DiscussionThis label identifies an ongoing discussion on a subject

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions