You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot seem to be able to use Realm.App.Sync.setLogLevel() or Realm.App.Sync.setLogger() in my react native app.
If I place Realm.App.Sync.setLogger() BEFORE const app = new Realm.App(appConfig); I get:
"Error: Exception in HostFunction: app must be of type 'object', got (undefined)". This makes sense to me, as app has not be defined yet.
If I place it straight AFTER const app = new Realm.App(appConfig);, I get:
"Error: Exception in HostFunction: Cannot set the logger factory after creating the sync client". Why am I getting this?
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
const appConfig = {
id: appId,
timeout: 10000,
app: {
name: "default",
version: "0",
},
};
Realm.App.Sync.setLogLevel(app, "debug"); // "all", "debug", "error", "info", "trace"
Realm.App.Sync.setLogger(app, (level, message) => console.log(`[${level}] ${message}`));
const app = new Realm.App(appConfig);
// I've also tried to place it here instead
// Realm.App.Sync.setLogLevel(app, "debug"); // "all", "debug", "error", "info", "trace"
// Realm.App.Sync.setLogger(app, (level, message) => console.log(`[${level}] ${message}`));### Version
The second example of setting the logger is the correct way. What version of Realm are you using?
I'm using [email protected]. When I use the second example of setting the logger, I get "Error: Exception in HostFunction: Cannot set the logger factory after creating the sync client". Any idea what tends to cause this error?
It sounds like you are setting the logger after opening the Realm. It is not supported - you see to set the logger and loglevel before opening any Realm.
How frequently does the bug occur?
Always
Description
I cannot seem to be able to use
Realm.App.Sync.setLogLevel()
orRealm.App.Sync.setLogger()
in my react native app.If I place
Realm.App.Sync.setLogger()
BEFOREconst app = new Realm.App(appConfig);
I get:"Error: Exception in HostFunction: app must be of type 'object', got (undefined)". This makes sense to me, as
app
has not be defined yet.If I place it straight AFTER
const app = new Realm.App(appConfig);
, I get:"Error: Exception in HostFunction: Cannot set the logger factory after creating the sync client". Why am I getting this?
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
[email protected]
What services are you using?
Both Atlas Device Sync and Atlas App Services
Are you using encryption?
No
Platform OS and version(s)
NA
Build environment
Which debugger for React Native: ..
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: