@certik/skynet 0.9.5 → 0.9.6
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 +4 -0
- package/log.js +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/log.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function getLine(params) {
|
|
2
|
-
let line =
|
|
2
|
+
let line = "";
|
|
3
3
|
|
|
4
4
|
// Convert to string and filter out newline to tabs (AWS Athena)
|
|
5
5
|
for (let i = 0, l = params.length; i < l; i++) {
|
|
@@ -11,12 +11,16 @@ function getLine(params) {
|
|
|
11
11
|
return line.trim();
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
function timestamp() {
|
|
15
|
+
return new Date().toISOString();
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
const inline = {
|
|
15
19
|
log: function (...args) {
|
|
16
|
-
console.log(getLine(args));
|
|
20
|
+
console.log(`${timestamp()} ${getLine(args)}`);
|
|
17
21
|
},
|
|
18
22
|
error: function (...args) {
|
|
19
|
-
console.error(getLine(args));
|
|
23
|
+
console.error(`${timestamp()} ${getLine(args)}`);
|
|
20
24
|
},
|
|
21
25
|
};
|
|
22
26
|
|