analogger 2.2.0 → 2.2.1
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 +13 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -303,7 +303,10 @@ Display the browser native message box if run from it; otherwise, it displays th
|
|
|
303
303
|
| requiredLogLevel | "LOG" | "LOG" / "INFO" / "WARN" / "ERROR" | _Define the log level from which the system can show a log entry_ |
|
|
304
304
|
| enableDate | false | boolean | _Show date + time (instead of time only)_ |
|
|
305
305
|
| logToLocalStorage | false | boolean | _Persist logs in browser localStorage_ |
|
|
306
|
-
| logToLocalStorageMax | 50 | number | _Max entries to keep in localStorage_
|
|
306
|
+
| logToLocalStorageMax | 50 | number | _Max entries to keep in localStorage_ |
|
|
307
|
+
| logToLocalStorageSize | 10000 | number | _Max size in bytes for localStorage logs_ |
|
|
308
|
+
| logToRemoteMaxEntries | undefined | number | _Number of entries to keep before relaying the data to the remote_ |
|
|
309
|
+
| logToRemoteDebounce | undefined | number | _Time in ms between two posts where the data can be sent to the server_ |
|
|
307
310
|
| compressArchives | false | boolean | _If true, rotates log files into a .tar.gz archive_ |
|
|
308
311
|
| compressionLevel | 1 | number | _Gzip compression level (0-9)_ |
|
|
309
312
|
| addArchiveTimestamp | true | boolean | _Appends a consistent timestamp to rotated files_ |
|
|
@@ -347,6 +350,13 @@ anaLogger.setOptions({logToRemote: true});
|
|
|
347
350
|
|
|
348
351
|
// Use your remote server (You are responsible for the back-end implementation)
|
|
349
352
|
anaLogger.setOptions({logToRemoteUrl: "http://your.server.com/data"});
|
|
353
|
+
|
|
354
|
+
// Batch remote logs (Send when 10 entries are reached OR after 5 seconds)
|
|
355
|
+
anaLogger.setOptions({
|
|
356
|
+
logToRemote: true,
|
|
357
|
+
logToRemoteMaxEntries: 10,
|
|
358
|
+
logToRemoteDebounce: 5000
|
|
359
|
+
});
|
|
350
360
|
```
|
|
351
361
|
|
|
352
362
|
> Your server must support the POST method.
|
|
@@ -1210,7 +1220,8 @@ You can now persist logs in the browser's Local Storage. This is useful for debu
|
|
|
1210
1220
|
// Enable local storage logging
|
|
1211
1221
|
anaLogger.setOptions({
|
|
1212
1222
|
logToLocalStorage: true,
|
|
1213
|
-
logToLocalStorageMax: 100 // Keep last 100 logs
|
|
1223
|
+
logToLocalStorageMax: 100, // Keep last 100 logs
|
|
1224
|
+
logToLocalStorageSize: 50000 // Limit to 50KB
|
|
1214
1225
|
});
|
|
1215
1226
|
|
|
1216
1227
|
// Restore logs from previous session after page reload
|