core-3nweb-client-lib 0.31.7 → 0.31.8
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.
|
@@ -45,7 +45,7 @@ function makeW3Nclient(clientSide, extraCAPs) {
|
|
|
45
45
|
storage: storage_cap_ipc_1.makeStorageCaller,
|
|
46
46
|
};
|
|
47
47
|
const clientW3N = (0, generic_1.makeClientSide)(clientSide, mainCAPs, extraCAPs);
|
|
48
|
-
|
|
48
|
+
addLogToConsoleToLogCap(clientW3N);
|
|
49
49
|
return clientW3N;
|
|
50
50
|
}
|
|
51
51
|
async function promiseW3Nclient(clientSide, extraCAPs) {
|
|
@@ -56,37 +56,37 @@ async function promiseW3Nclient(clientSide, extraCAPs) {
|
|
|
56
56
|
storage: storage_cap_ipc_1.promiseStorageCaller,
|
|
57
57
|
};
|
|
58
58
|
const clientW3N = await (0, generic_1.promiseClientSide)(clientSide, mainCAPs, extraCAPs);
|
|
59
|
-
|
|
59
|
+
addLogToConsoleToLogCap(clientW3N);
|
|
60
60
|
return clientW3N;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
console.error(msg, err);
|
|
71
|
-
}
|
|
62
|
+
function addLogToConsoleToLogCap(clientW3N) {
|
|
63
|
+
const logCap = clientW3N.log;
|
|
64
|
+
clientW3N.log = async (type, msg, err) => {
|
|
65
|
+
if (type === 'error') {
|
|
66
|
+
if (err === undefined) {
|
|
67
|
+
console.error(msg);
|
|
72
68
|
}
|
|
73
|
-
else
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
else {
|
|
70
|
+
console.error(msg, err);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (type === 'warning') {
|
|
74
|
+
if (err === undefined) {
|
|
75
|
+
console.warn(msg);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.warn(msg, err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
if (err === undefined) {
|
|
83
|
+
console.log(msg);
|
|
80
84
|
}
|
|
81
85
|
else {
|
|
82
|
-
|
|
83
|
-
console.log(msg);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
console.log(msg, err);
|
|
87
|
-
}
|
|
86
|
+
console.log(msg, err);
|
|
88
87
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
88
|
+
}
|
|
89
|
+
await (logCap === null || logCap === void 0 ? void 0 : logCap(type, msg, err));
|
|
90
|
+
};
|
|
91
91
|
}
|
|
92
92
|
Object.freeze(exports);
|