@appzung/react-native-code-push v11.0.3
@appzung/react-native-code-push / setLogger
setLogger(
logger):void
Set a custom logger function to handle all CodePush logs
A function that takes a log level and message and handles the logging
void
import { setLogger, LogLevel } from '@appzung/react-native-code-push';
// Custom logger that sends critical logs to a crash reporting service
setLogger((level, message) => {
// Always log to console
console.log(`[CodePush] ${message}`);
// Send error logs to crash reporting
if (level === LogLevel.ERROR) {
MyCrashReportingService.log(`CodePush error: ${message}`);
}
});