Document Realm.Sync.setSyncLogger
See original GitHub issueGoals
To implement https://github.com/realm/realm-studio-private/issues/16 it would be great to get a way to intercept messages logged by the sync client.
Expected Results
It would be great to be able to set a callback which would get called when the client wants to log a message, overriding the default behaviour of printing to the console:
enum LogLevel {
All = 'all'
Trace = 'trace'
Debug = 'debug'
Detail = 'detail'
Info = 'info'
Warn = 'warn'
Error = 'error'
Fatal = 'fatal'
Off = 'off'
};
Realm.Sync.setLogCallback((level: LogLevel, message: string) => {
// Do whatever with the message ...
});
// Because `setLogCallback` was called no messages are logged to the console.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Realm.App.Sync.SubscriptionsState - MongoDB
Enable multiplexing multiple sync sessions over a single connection for a Realm app. When having a lot of synchronized realms open the system...
Read more >Disable Realm Sync only for non-premium users
I plan to sync all my User (custom document in a collection) records for all users (premium + non-premium). My guess is I...
Read more >Scalable Realm Sync Design - YouTube
Learn what Realm is, why Sync matters, and the use cases that drive this need - empowering businesses to become mobile-first as they...
Read more >Introduction to the MongoDB Realm Sync - Medium
Step 5: Add the Realm ID to the Android Project. Copy the Realm app ID and use it to replace App Key in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll try it out - thanks! I’ll give it a spin when I get to the issue then 👍 It would be awesome to get it documented though.
I don’t know if this should be a separate request, but it would be great if we could reuse that to avoid realm-js logging to the console in general - e.g. in user-methods there’s a
print_error
method that should use the log callback rather than the console.