@joystick.js/node-canary 0.0.0-canary.350 → 0.0.0-canary.352

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/dist/index.js CHANGED
@@ -17,7 +17,9 @@ import pushLogs from "./push/logs/index.js";
17
17
  import nodeUrlPolyfills from "./lib/nodeUrlPolyfills.js";
18
18
  import sendEmail from "./email/send";
19
19
  const { readFile } = fs.promises;
20
- await pushLogs();
20
+ if (process.env.NODE_ENV !== "development" && process.env.IS_PUSH_DEPLOYED) {
21
+ await pushLogs();
22
+ }
21
23
  const generate_sql_from_object = _generate_sql_from_object;
22
24
  const accounts = _accounts;
23
25
  const action = _action;
@@ -25,29 +25,23 @@ const captureLog = (callback = null) => {
25
25
  var logs_default = async () => {
26
26
  const mongodb = await connectMongoDB();
27
27
  return captureLog(async (source = "", data = "") => {
28
- console.log({
29
- source,
30
- data
31
- });
32
28
  switch (source) {
33
29
  case "stdout":
34
- await mongodb.collection("logs").insertOne({
30
+ return mongodb.collection("logs").insertOne({
35
31
  error: false,
36
32
  timestamp: timestamps.get_current_time(),
37
33
  process_id: process.pid,
38
34
  data
39
35
  });
40
- return true;
41
36
  case "stderr":
42
37
  case "uncaughtException":
43
38
  case "unhandledRejection":
44
- await mongodb.collection("logs").insertOne({
39
+ return mongodb.collection("logs").insertOne({
45
40
  error: true,
46
41
  timestamp: timestamps.get_current_time(),
47
42
  process_id: process.pid,
48
43
  data
49
44
  });
50
- return true;
51
45
  default:
52
46
  return true;
53
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
- "version": "0.0.0-canary.350",
3
+ "version": "0.0.0-canary.352",
4
4
  "type": "module",
5
5
  "description": "A Node.js framework for building web apps.",
6
6
  "main": "./dist/index.js",