@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.
Files changed (3) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/log.js +13 -5
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.13
4
+
5
+ - Added `inline.error` function to `log` library
6
+
3
7
  ## 0.8.12
4
8
 
5
- - Added `log` library for use with AWS Athena
9
+ - Added `log` library to print one line log
6
10
 
7
11
  ## 0.8.11
8
12
 
package/log.js CHANGED
@@ -1,15 +1,23 @@
1
- var inline = {};
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 = args.length; i < l; i++) {
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 += `${args[i]} `.replace(/\n/gm, "\t");
8
+ line += `${params[i]} `.replace(/\n/gm, "\t");
10
9
  }
11
10
 
12
- console.log(line.trim());
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 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.8.12",
3
+ "version": "0.8.13",
4
4
  "description": "Skynet Shared JS library",
5
5
  "main": "index.js",
6
6
  "author": "CertiK Engineering",