eletrotupi / tcc/ commit / e942921

api: add pino to improve logs a bit more

Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago e942921e5baaa9a7ed8ee6a62c1ad3a5d5eae07d Browse files
Parents fe96326
Changed files
2
Additions
+144
Deletions
-1
api/package-lock.json modified+142 -1
api/package-lock.json
1 1
{
2 2
  "name": "orbit-api",
3 3
  "version": "0.0.0",
4 4
  "lockfileVersion": 3,
5 5
  "requires": true,
25 25
        "jsonwebtoken": "^9.0.3",
26 26
        "morgan": "^1.10.1",
27 27
        "multer": "^2.1.1",
28 28
        "multer-s3": "^3.0.1",
29 29
        "pg": "^8.20.0",
30 +
        "pino": "^10.3.1",
31 +
        "pino-http": "^11.0.0",
30 32
        "resend": "^6.12.3",
31 33
        "zod": "^4.4.3"
32 34
      },
33 35
      "devDependencies": {
34 36
        "@ava/typescript": "^6.0.0",
1402 1404
      "license": "MIT",
1403 1405
      "dependencies": {
1404 1406
        "@noble/hashes": "^1.1.5"
1405 1407
      }
1406 1408
    },
1409 +
    "node_modules/@pinojs/redact": {
1410 +
      "version": "0.4.0",
1411 +
      "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz",
1412 +
      "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==",
1413 +
      "license": "MIT"
1414 +
    },
1407 1415
    "node_modules/@pkgjs/parseargs": {
1408 1416
      "version": "0.11.0",
1409 1417
      "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
1410 1418
      "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
1411 1419
      "dev": true,
2259 2267
      "version": "0.4.0",
2260 2268
      "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
2261 2269
      "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
2262 2270
      "dev": true,
2263 2271
      "license": "MIT"
2272 +
    },
2273 +
    "node_modules/atomic-sleep": {
2274 +
      "version": "1.0.0",
2275 +
      "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
2276 +
      "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==",
2277 +
      "license": "MIT",
2278 +
      "engines": {
2279 +
        "node": ">=8.0.0"
2280 +
      }
2264 2281
    },
2265 2282
    "node_modules/ava": {
2266 2283
      "version": "6.4.1",
2267 2284
      "resolved": "https://registry.npmjs.org/ava/-/ava-6.4.1.tgz",
2268 2285
      "integrity": "sha512-vxmPbi1gZx9zhAjHBgw81w/iEDKcrokeRk/fqDTyA2DQygZ0o+dUGRHFOtX8RA5N0heGJTTsIk7+xYxitDb61Q==",
5198 5215
    },
5199 5216
    "node_modules/get-caller-file": {
5200 5217
      "version": "2.0.5",
5201 5218
      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
5202 5219
      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
5203 -
      "dev": true,
5204 5220
      "license": "ISC",
5205 5221
      "engines": {
5206 5222
        "node": "6.* || 8.* || >= 10.*"
5207 5223
      }
5208 5224
    },
6924 6940
      "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz",
6925 6941
      "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==",
6926 6942
      "devOptional": true,
6927 6943
      "license": "MIT"
6928 6944
    },
6945 +
    "node_modules/on-exit-leak-free": {
6946 +
      "version": "2.1.2",
6947 +
      "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz",
6948 +
      "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==",
6949 +
      "license": "MIT",
6950 +
      "engines": {
6951 +
        "node": ">=14.0.0"
6952 +
      }
6953 +
    },
6929 6954
    "node_modules/on-finished": {
6930 6955
      "version": "2.4.1",
6931 6956
      "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
6932 6957
      "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
6933 6958
      "license": "MIT",
7233 7258
      },
7234 7259
      "funding": {
7235 7260
        "url": "https://github.com/sponsors/jonschlinkert"
7236 7261
      }
7237 7262
    },
7263 +
    "node_modules/pino": {
7264 +
      "version": "10.3.1",
7265 +
      "resolved": "https://registry.npmjs.org/pino/-/pino-10.3.1.tgz",
7266 +
      "integrity": "sha512-r34yH/GlQpKZbU1BvFFqOjhISRo1MNx1tWYsYvmj6KIRHSPMT2+yHOEb1SG6NMvRoHRF0a07kCOox/9yakl1vg==",
7267 +
      "license": "MIT",
7268 +
      "dependencies": {
7269 +
        "@pinojs/redact": "^0.4.0",
7270 +
        "atomic-sleep": "^1.0.0",
7271 +
        "on-exit-leak-free": "^2.1.0",
7272 +
        "pino-abstract-transport": "^3.0.0",
7273 +
        "pino-std-serializers": "^7.0.0",
7274 +
        "process-warning": "^5.0.0",
7275 +
        "quick-format-unescaped": "^4.0.3",
7276 +
        "real-require": "^0.2.0",
7277 +
        "safe-stable-stringify": "^2.3.1",
7278 +
        "sonic-boom": "^4.0.1",
7279 +
        "thread-stream": "^4.0.0"
7280 +
      },
7281 +
      "bin": {
7282 +
        "pino": "bin.js"
7283 +
      }
7284 +
    },
7285 +
    "node_modules/pino-abstract-transport": {
7286 +
      "version": "3.0.0",
7287 +
      "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz",
7288 +
      "integrity": "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==",
7289 +
      "license": "MIT",
7290 +
      "dependencies": {
7291 +
        "split2": "^4.0.0"
7292 +
      }
7293 +
    },
7294 +
    "node_modules/pino-http": {
7295 +
      "version": "11.0.0",
7296 +
      "resolved": "https://registry.npmjs.org/pino-http/-/pino-http-11.0.0.tgz",
7297 +
      "integrity": "sha512-wqg5XIAGRRIWtTk8qPGxkbrfiwEWz1lgedVLvhLALudKXvg1/L2lTFgTGPJ4Z2e3qcRmxoFxDuSdMdMGNM6I1g==",
7298 +
      "license": "MIT",
7299 +
      "dependencies": {
7300 +
        "get-caller-file": "^2.0.5",
7301 +
        "pino": "^10.0.0",
7302 +
        "pino-std-serializers": "^7.0.0",
7303 +
        "process-warning": "^5.0.0"
7304 +
      }
7305 +
    },
7306 +
    "node_modules/pino-std-serializers": {
7307 +
      "version": "7.1.0",
7308 +
      "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz",
7309 +
      "integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==",
7310 +
      "license": "MIT"
7311 +
    },
7238 7312
    "node_modules/pkg-types": {
7239 7313
      "version": "2.3.0",
7240 7314
      "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz",
7241 7315
      "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==",
7242 7316
      "devOptional": true,
7419 7493
      "license": "MIT",
7420 7494
      "engines": {
7421 7495
        "node": ">= 0.6"
7422 7496
      }
7423 7497
    },
7498 +
    "node_modules/process-warning": {
7499 +
      "version": "5.0.0",
7500 +
      "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz",
7501 +
      "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==",
7502 +
      "funding": [
7503 +
        {
7504 +
          "type": "github",
7505 +
          "url": "https://github.com/sponsors/fastify"
7506 +
        },
7507 +
        {
7508 +
          "type": "opencollective",
7509 +
          "url": "https://opencollective.com/fastify"
7510 +
        }
7511 +
      ],
7512 +
      "license": "MIT"
7513 +
    },
7424 7514
    "node_modules/proper-lockfile": {
7425 7515
      "version": "4.1.2",
7426 7516
      "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
7427 7517
      "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==",
7428 7518
      "devOptional": true,
7537 7627
          "url": "https://feross.org/support"
7538 7628
        }
7539 7629
      ],
7540 7630
      "license": "MIT"
7541 7631
    },
7632 +
    "node_modules/quick-format-unescaped": {
7633 +
      "version": "4.0.4",
7634 +
      "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
7635 +
      "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==",
7636 +
      "license": "MIT"
7637 +
    },
7542 7638
    "node_modules/range-parser": {
7543 7639
      "version": "1.2.1",
7544 7640
      "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
7545 7641
      "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
7546 7642
      "license": "MIT",
7638 7734
        "node": ">= 14.18.0"
7639 7735
      },
7640 7736
      "funding": {
7641 7737
        "type": "individual",
7642 7738
        "url": "https://paulmillr.com/funding/"
7739 +
      }
7740 +
    },
7741 +
    "node_modules/real-require": {
7742 +
      "version": "0.2.0",
7743 +
      "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
7744 +
      "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==",
7745 +
      "license": "MIT",
7746 +
      "engines": {
7747 +
        "node": ">= 12.13.0"
7643 7748
      }
7644 7749
    },
7645 7750
    "node_modules/redis-errors": {
7646 7751
      "version": "1.2.0",
7647 7752
      "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz",
7902 8007
          "url": "https://feross.org/support"
7903 8008
        }
7904 8009
      ],
7905 8010
      "license": "MIT"
7906 8011
    },
8012 +
    "node_modules/safe-stable-stringify": {
8013 +
      "version": "2.5.0",
8014 +
      "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
8015 +
      "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
8016 +
      "license": "MIT",
8017 +
      "engines": {
8018 +
        "node": ">=10"
8019 +
      }
8020 +
    },
7907 8021
    "node_modules/safer-buffer": {
7908 8022
      "version": "2.1.2",
7909 8023
      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
7910 8024
      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
7911 8025
      "license": "MIT"
8187 8301
      "engines": {
8188 8302
        "node": ">=12"
8189 8303
      },
8190 8304
      "funding": {
8191 8305
        "url": "https://github.com/chalk/slice-ansi?sponsor=1"
8306 +
      }
8307 +
    },
8308 +
    "node_modules/sonic-boom": {
8309 +
      "version": "4.2.1",
8310 +
      "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz",
8311 +
      "integrity": "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==",
8312 +
      "license": "MIT",
8313 +
      "dependencies": {
8314 +
        "atomic-sleep": "^1.0.0"
8192 8315
      }
8193 8316
    },
8194 8317
    "node_modules/source-map": {
8195 8318
      "version": "0.5.7",
8196 8319
      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
8609 8732
      "dev": true,
8610 8733
      "license": "MIT",
8611 8734
      "engines": {
8612 8735
        "node": ">=14.16"
8613 8736
      }
8737 +
    },
8738 +
    "node_modules/thread-stream": {
8739 +
      "version": "4.2.0",
8740 +
      "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-4.2.0.tgz",
8741 +
      "integrity": "sha512-e2zZ96wSChazBsbENf/Pcm/4swHt2cEKQ92rhUjkL9GCKiTDJIaTBenjE/m9DXi0QBmTMDkFDdOomUy20A1tDQ==",
8742 +
      "license": "MIT",
8743 +
      "dependencies": {
8744 +
        "real-require": "^1.0.0"
8745 +
      },
8746 +
      "engines": {
8747 +
        "node": ">=20"
8748 +
      }
8749 +
    },
8750 +
    "node_modules/thread-stream/node_modules/real-require": {
8751 +
      "version": "1.0.0",
8752 +
      "resolved": "https://registry.npmjs.org/real-require/-/real-require-1.0.0.tgz",
8753 +
      "integrity": "sha512-P4nbQYQfePJxRSmY+v/KINxVucm4NF3p3s7pJveMTtom52FR4YGltUQLB8idDXwDDWW+eYrWDFbuzUnjoWHF7g==",
8754 +
      "license": "MIT"
8614 8755
    },
8615 8756
    "node_modules/time-zone": {
8616 8757
      "version": "1.0.0",
8617 8758
      "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz",
8618 8759
      "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==",
9389 9530
        "url": "https://github.com/sponsors/colinhacks"
9390 9531
      }
9391 9532
    }
9392 9533
  }
9393 9534
}
api/package.json modified+2
api/package.json
1 1
{
2 2
  "name": "orbit-api",
3 3
  "version": "0.0.0",
4 4
  "description": "",
5 5
  "license": "ISC",
35 35
    "jsonwebtoken": "^9.0.3",
36 36
    "morgan": "^1.10.1",
37 37
    "multer": "^2.1.1",
38 38
    "multer-s3": "^3.0.1",
39 39
    "pg": "^8.20.0",
40 +
    "pino": "^10.3.1",
41 +
    "pino-http": "^11.0.0",
40 42
    "resend": "^6.12.3",
41 43
    "zod": "^4.4.3"
42 44
  },
43 45
  "devDependencies": {
44 46
    "@ava/typescript": "^6.0.0",
59 61
    "tsconfig-paths": "^4.2.0",
60 62
    "tsx": "^4.21.0",
61 63
    "typescript": "^6.0.2"
62 64
  }
63 65
}