1.0.3 • Published 5 years ago

react-native-log-to-file v1.0.3

Weekly downloads
10
License
ISC
Repository
github
Last release
5 years ago

react-native-log-to-file

Log message to file in react native, work for Android. Get memory information, just work for Android.

Installation

Install package from npm

npm install --save react-native-log-to-file

or

yarn add react-native-log-to-file

Link to your project

react-native link

Usage

log to file

import log from 'react-native-log-to-file';
log.logToFile('app started').then(res=>{
    console.log(res);
})

The log file locate in 'applicationName/applicationName_log.log'.

get used memory

import log from 'react-native-log-to-file';
Log.getUsedMemory().then(usedMemory => {
    let used = (usedMemory / 1024 / 1024).toFixed(2);
})

get max memory

import log from 'react-native-log-to-file';
Log.getMaxMemory().then(maxMemory => {
    let max = (maxMemory / 1024 / 1024).toFixed(2);
})

get total memory

import log from 'react-native-log-to-file';
Log.getTotalMemory().then(totalMemory => {
    let total = (totalMemory / 1024 / 1024).toFixed(2);
})
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago