@joystick.js/node-canary 0.0.0-canary.305 → 0.0.0-canary.306

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.
@@ -1,5 +1,6 @@
1
1
  import dayjs from "dayjs";
2
2
  import TuskDB from "@tuskdb/node";
3
+ import timestamps from "../../lib/timestamps";
3
4
  const captureLog = (callback = null) => {
4
5
  process.stdout.write = (data) => {
5
6
  if (callback) {
@@ -26,6 +27,7 @@ const writeLogsToDisk = () => {
26
27
  const db = new TuskDB({
27
28
  file: {
28
29
  development: "logs.json",
30
+ staging: "/root/logs.json",
29
31
  production: "/root/logs.json"
30
32
  }[process.env.NODE_ENV || "development"],
31
33
  collections: {
@@ -37,14 +39,14 @@ const writeLogsToDisk = () => {
37
39
  case "stdout":
38
40
  return db.collection("logs").insertOne({
39
41
  error: false,
40
- timestamp: dayjs().format(),
42
+ timestamp: timestamps.get_current_time(),
41
43
  data
42
44
  });
43
45
  case "stderr":
44
46
  case "uncaughtException":
45
47
  return db.collection("logs").insertOne({
46
48
  error: true,
47
- timestamp: dayjs().format(),
49
+ timestamp: timestamps.get_current_time(),
48
50
  data
49
51
  });
50
52
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
- "version": "0.0.0-canary.305",
3
+ "version": "0.0.0-canary.306",
4
4
  "type": "module",
5
5
  "description": "A Node.js framework for building web apps.",
6
6
  "main": "./dist/index.js",