Any reason why logType isn't exported?
radiodario opened this issue · 1 comments
radiodario commented
I'm writing a class with its own custom logger instance and using typescript I can't make a logger instance a typed property / member of the class correctly - since logTyped
isn't exported:
import RNFS from 'react-native-fs';
import { logger } from 'react-native-logs';
export default class CallLoger {
loggerInstance: logTyped;
constructor(props) {
// ...
}
initialise(callId, userId) {
this.loggerInstance = logger.createLogger({
// ...
});
}
}
Typescript complains here - Am I using the wrong approach? I want to have a long lived class that initialises a logger which writes to a new file each time, but that is initialised several times during the app's lifecycle
Thanks!
radiodario commented
answered my own question:
import { logger } from 'react-native-logs';
// ...
loggerInstance: ReturnType<typeof logger.createLogger>