cordova-plugin-unvired-logger 0.0.20 → 0.0.22
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/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/browser/Logger.js +12 -12
- package/src/electron/package.json +1 -1
- package/src/ios/Logger.swift +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cordova-plugin-unvired-logger",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "A logger plugin for Electron, Android, Browser, and iOS that appends logs to log.txt files organized by user ID.",
|
|
5
5
|
"cordova": {
|
|
6
6
|
"id": "cordova-plugin-unvired-logger",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<plugin id="cordova-plugin-unvired-logger" version="0.0.
|
|
2
|
+
<plugin id="cordova-plugin-unvired-logger" version="0.0.22"
|
|
3
3
|
xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
4
4
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
5
5
|
|
package/src/browser/Logger.js
CHANGED
|
@@ -150,19 +150,19 @@ async function logWitLevel(successCallback, errorCallback, args) {
|
|
|
150
150
|
// Log to console for browser debugging
|
|
151
151
|
console.log(data);
|
|
152
152
|
|
|
153
|
-
// Store in localStorage
|
|
154
|
-
const storageKey = getStorageKey(userId, LOG_FILE_NAME);
|
|
155
|
-
const existingContent = localStorage.getItem(storageKey) || '';
|
|
156
|
-
const newContent = existingContent + data;
|
|
153
|
+
// // Store in localStorage
|
|
154
|
+
// const storageKey = getStorageKey(userId, LOG_FILE_NAME);
|
|
155
|
+
// const existingContent = localStorage.getItem(storageKey) || '';
|
|
156
|
+
// const newContent = existingContent + data;
|
|
157
157
|
|
|
158
|
-
// Check size limit
|
|
159
|
-
if (newContent.length > MAX_LOG_SIZE) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
} else {
|
|
164
|
-
|
|
165
|
-
}
|
|
158
|
+
// // Check size limit
|
|
159
|
+
// if (newContent.length > MAX_LOG_SIZE) {
|
|
160
|
+
// // If content is too large, truncate it
|
|
161
|
+
// const truncatedContent = newContent.substring(newContent.length - MAX_LOG_SIZE / 2);
|
|
162
|
+
// localStorage.setItem(storageKey, truncatedContent);
|
|
163
|
+
// } else {
|
|
164
|
+
// localStorage.setItem(storageKey, newContent);
|
|
165
|
+
// }
|
|
166
166
|
|
|
167
167
|
successCallback(`Logged to browser storage: ${storageKey}`);
|
|
168
168
|
} catch (err) {
|
package/src/ios/Logger.swift
CHANGED
|
@@ -61,7 +61,9 @@ import UIKit
|
|
|
61
61
|
let logEntry = self.formatLogEntry(level: level, sourceClass: sourceClass, sourceMethod: sourceMethod, message: message)
|
|
62
62
|
|
|
63
63
|
// Print to console before writing to file
|
|
64
|
+
#if DEBUG
|
|
64
65
|
NSLog("%@", logEntry.trimmingCharacters(in: .whitespacesAndNewlines))
|
|
66
|
+
#endif
|
|
65
67
|
self.commandDelegate.run(inBackground: {
|
|
66
68
|
// Serialize rotation + write to guarantee ordering
|
|
67
69
|
self.logWriteQueue.async {
|