@certik/skynet 0.8.12 → 0.8.13
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/CHANGELOG.md +5 -1
- package/log.js +13 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/log.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
inline.log = function (...args) {
|
|
1
|
+
function getLine(params) {
|
|
3
2
|
let line = `${new Date().toISOString()}\t`;
|
|
4
3
|
|
|
5
4
|
// Convert to string and filter out newline to tabs (AWS Athena)
|
|
6
|
-
for (let i = 0, l =
|
|
5
|
+
for (let i = 0, l = params.length; i < l; i++) {
|
|
7
6
|
// Certain objects don't get converted
|
|
8
7
|
// Note using JSON.stringfy may be too slow for large objects
|
|
9
|
-
line += `${
|
|
8
|
+
line += `${params[i]} `.replace(/\n/gm, "\t");
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
return line.trim();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const inline = {
|
|
15
|
+
log: function (...args) {
|
|
16
|
+
console.log(getLine(args));
|
|
17
|
+
},
|
|
18
|
+
error: function (...args) {
|
|
19
|
+
console.error(getLine(args));
|
|
20
|
+
},
|
|
13
21
|
};
|
|
14
22
|
|
|
15
23
|
module.exports = {
|