cordova-plugin-unvired-logger 0.0.25 → 0.0.26
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/electron/package.json +1 -1
- package/src/ios/Logger.swift +20 -2
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.26",
|
|
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.26"
|
|
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/ios/Logger.swift
CHANGED
|
@@ -90,12 +90,30 @@ import UIKit
|
|
|
90
90
|
|
|
91
91
|
@objc(setLogLevel:)
|
|
92
92
|
func setLogLevel(_ command: CDVInvokedUrlCommand) {
|
|
93
|
-
guard let
|
|
94
|
-
let level = args["level"] as? Int else {
|
|
93
|
+
guard let levelObj = command.arguments.first else {
|
|
95
94
|
sendErrorResult(command.callbackId, message: "Invalid log level")
|
|
96
95
|
return
|
|
97
96
|
}
|
|
98
97
|
|
|
98
|
+
var level: Int = 8 // Default to ERROR level
|
|
99
|
+
|
|
100
|
+
if let levelInt = levelObj as? Int {
|
|
101
|
+
level = levelInt
|
|
102
|
+
} else if let levelStr = levelObj as? String {
|
|
103
|
+
if let levelInt = Int(levelStr) {
|
|
104
|
+
level = levelInt
|
|
105
|
+
} else {
|
|
106
|
+
let lowerStr = levelStr.lowercased()
|
|
107
|
+
if lowerStr == "debug" {
|
|
108
|
+
level = 9
|
|
109
|
+
} else if lowerStr == "error" {
|
|
110
|
+
level = 8
|
|
111
|
+
} else if lowerStr == "important" {
|
|
112
|
+
level = 7
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
99
117
|
defaultLogLevel = level
|
|
100
118
|
sendSuccessResult(command.callbackId, message: "Log level set to \(level)")
|
|
101
119
|
}
|