Files
iNaturalistReactNative/react-native-logs.config.js
Corey Farwell a43446909c Remove the need to specify TypeScript file extensions in imports (#3094)
* Don't require TS extensions in imports

* Resolve all import extension errors

* Remove file extension from import paths used in mocks

* Remove .d of type definition file paths

* Remove .d of type definition file and import as type

---------

Co-authored-by: Johannes Klein <johannes.t.klein@gmail.com>
2025-09-07 23:41:42 +02:00

42 lines
828 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
};