mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 14:08:56 -05:00
* (lint) MOB-1063 enforce trailing commas * autofix trailing commas * manually fix newly introduced maxlen violations * add trailing comma convention to i18n build
42 lines
833 B
JavaScript
42 lines
833 B
JavaScript
import iNatLogstashTransport from "api/log";
|
|
import RNFS from "react-native-fs";
|
|
import {
|
|
consoleTransport,
|
|
fileAsyncTransport,
|
|
logger,
|
|
} from "react-native-logs";
|
|
|
|
const fileName = "inaturalist-rn-log.txt";
|
|
const logFilePath = `${RNFS.DocumentDirectoryPath}/${fileName}`;
|
|
|
|
const transport = [];
|
|
transport.push( consoleTransport );
|
|
transport.push( fileAsyncTransport );
|
|
transport.push( iNatLogstashTransport );
|
|
|
|
const config = {
|
|
dateFormat: "iso",
|
|
// eslint-disable-next-line no-undef
|
|
severity: __DEV__
|
|
? "debug"
|
|
: "info",
|
|
transport,
|
|
transportOptions: {
|
|
FS: RNFS,
|
|
fileName,
|
|
},
|
|
};
|
|
|
|
const log = logger.createLogger( config );
|
|
|
|
const logWithoutRemote = logger.createLogger( {
|
|
...config,
|
|
transport: [consoleTransport, fileAsyncTransport],
|
|
} );
|
|
|
|
export {
|
|
log,
|
|
logFilePath,
|
|
logWithoutRemote,
|
|
};
|