Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: __reanimatedLoggerConfig is not defined on edge runtime #6880

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-native-reanimated/src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function registerLoggerConfig(config: LoggerConfigInternal) {
*/
export function replaceLoggerImplementation(logFunction: LogFunction) {
'worklet';
registerLoggerConfig({ ...__reanimatedLoggerConfig, logFunction });
registerLoggerConfig({ ...global.__reanimatedLoggerConfig, logFunction });
}

/**
Expand All @@ -108,7 +108,7 @@ export function replaceLoggerImplementation(logFunction: LogFunction) {
export function updateLoggerConfig(options?: Partial<LoggerConfig>) {
'worklet';
registerLoggerConfig({
...__reanimatedLoggerConfig,
...global.__reanimatedLoggerConfig,
// Don't reuse previous level and strict values from the global config
level: options?.level ?? DEFAULT_LOGGER_CONFIG.level,
strict: options?.strict ?? DEFAULT_LOGGER_CONFIG.strict,
Expand All @@ -125,7 +125,7 @@ function handleLog(
options: LogOptions
) {
'worklet';
const config = __reanimatedLoggerConfig;
const config = global.__reanimatedLoggerConfig;
if (
// Don't log if the log is marked as strict-only and the config doesn't
// enable strict logging
Expand Down