@dittolive/ditto 4.8.0-rc.1 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,10 +3,10 @@
3
3
  _Ditto is a cross-platform SDK that allows mobile, web, and IoT apps to sync
4
4
  with and even without connectivity._
5
5
 
6
- Version: **4.8.0-rc.1**
6
+ Version: **4.8.0**
7
7
 
8
8
  For more information please visit [ditto.live](https://ditto.live), as well as the
9
- [API Reference](https://software.ditto.live/js/Ditto/4.8.0-rc.1/api-reference/) for this particular version.
9
+ [API Reference](https://software.ditto.live/js/Ditto/4.8.0/api-reference/) for this particular version.
10
10
 
11
11
  ---
12
12
 
package/node/ditto.cjs.js CHANGED
@@ -2233,7 +2233,7 @@ class AttachmentToken {
2233
2233
 
2234
2234
  // NOTE: this is patched up with the actual build version by Jake task
2235
2235
  // build:package and has to be a valid semantic version as defined here: https://semver.org.
2236
- const fullBuildVersionString = '4.8.0-rc.1';
2236
+ const fullBuildVersionString = '4.8.0';
2237
2237
 
2238
2238
  //
2239
2239
  // Copyright © 2021 DittoLive Incorporated. All rights reserved.
@@ -2318,7 +2318,13 @@ class Logger {
2318
2318
  var _a;
2319
2319
  this.setLogFile((_a = url === null || url === void 0 ? void 0 : url.pathname) !== null && _a !== void 0 ? _a : null);
2320
2320
  }
2321
- /** Whether the logger is currently enabled. */
2321
+ /**
2322
+ * Whether the logger is currently enabled.
2323
+ *
2324
+ * Logs exported through {@link exportToFile | exportToFile()} are not
2325
+ * affected by this setting and will also include logs emitted while
2326
+ * {@link enabled} is `false`.
2327
+ */
2322
2328
  static get enabled() {
2323
2329
  return loggerEnabledGet();
2324
2330
  }
@@ -2345,6 +2351,9 @@ class Logger {
2345
2351
  *
2346
2352
  * For example if this is set to `Warning`, then only logs that are logged
2347
2353
  * with the `Warning` or `Error` log levels will be shown.
2354
+ *
2355
+ * Logs exported through {@link exportToFile | exportToFile()} are not
2356
+ * affected by this setting and include all logs at `Debug` level and above.
2348
2357
  */
2349
2358
  static get minimumLogLevel() {
2350
2359
  return loggerMinimumLogLevelGet();
@@ -2373,10 +2382,14 @@ class Logger {
2373
2382
  * unregister any previous callback and stop reporting log entries through
2374
2383
  * callbacks.
2375
2384
  *
2385
+ * @throws {TypeError} if `callback` is not a function or `undefined`.
2376
2386
  * @throws {Error} if called in a React Native environment.
2377
2387
  */
2378
2388
  static async setCustomLogCallback(callback) {
2379
- if (callback) {
2389
+ if (callback != null && typeof callback !== 'function') {
2390
+ throw new TypeError(`Expected parameter 'callback' to be a function or undefined, but got ${typeof callback}.`);
2391
+ }
2392
+ if (callback != null) {
2380
2393
  await loggerSetCustomLogCb(callback);
2381
2394
  this._customLogCallback = callback;
2382
2395
  }
@@ -2389,25 +2402,25 @@ class Logger {
2389
2402
  * Exports collected logs to a compressed and JSON-encoded file on the local
2390
2403
  * file system.
2391
2404
  *
2392
- * Ditto's logger locally collects up to 15 MB of logs when it is enabled,
2393
- * periodically discarding older logs once that limit is reached. These logs
2394
- * can be requested and downloaded from any peer that is active in a Ditto
2395
- * app using the portal's device dashboard. This method provides an alternative
2396
- * way of accessing those logs by exporting them to the local file system.
2405
+ * Ditto's logger locally collects a limited amount of logs at `Debug` level
2406
+ * and above, periodically discarding older logs. This internal logger is
2407
+ * always enabled and works independently of the {@link Logger.enabled}
2408
+ * setting and the configured {@link Logger.minimumLogLevel}. Its logs can be
2409
+ * requested and downloaded from any peer that is active in a Ditto app using
2410
+ * the portal's device dashboard. This method provides an alternative way of
2411
+ * accessing those logs by exporting them to the local file system.
2397
2412
  *
2398
- * The logs will be written as a gzip compressed file at the path specified
2399
- * by the `path` parameter. When uncompressed, the file contains one JSON
2400
- * value per line with the oldest entry on the first line (JSON lines format).
2413
+ * The logs will be written as a gzip compressed file at the path specified by
2414
+ * the `path` parameter. When uncompressed, the file contains one JSON value
2415
+ * per line with the oldest entry on the first line (JSON lines format).
2401
2416
  *
2402
- * Collection of logs requires having previously enabled logging at the
2403
- * desired verbosity level using {@link Logger.enabled} and
2404
- * {@link Logger.minimumLogLevel}. Ditto limits the amount of logs it retains
2405
- * on disk to a maximum of 15 MB, so setting a lower verbosity level can
2406
- * extend the time period covered by the exported logs up to a maximum of
2407
- * three days.
2417
+ * Ditto limits the amount of logs it retains on disk to 15 MB and a maximum
2418
+ * age of three days. Older logs are periodically discarded once one of these
2419
+ * limits is reached.
2408
2420
  *
2409
2421
  * This method currently only exports logs from the most recently created
2410
- * Ditto instance, even when multiple instances are running in the same process.
2422
+ * Ditto instance, even when multiple instances are running in the same
2423
+ * process.
2411
2424
  *
2412
2425
  * Not supported in browser environments.
2413
2426
  *
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dittolive/ditto",
3
- "version": "4.8.0-rc.1",
3
+ "version": "4.8.0",
4
4
  "description": "Ditto is a cross-platform embeddable NoSQL database that can sync with or without an internet connection.",
5
5
  "homepage": "https://ditto.live",
6
6
  "license": "SEE LICENSE IN LICENSE.md",