From 3fd26006ae05fa77f0355b61aaae607ed267ffb9 Mon Sep 17 00:00:00 2001 From: twobiers <22715034+twobiers@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:41:10 +0200 Subject: [PATCH] Add logger --- package-lock.json | 32 +++++++++++--------------------- package.json | 1 + src/logger.ts | 5 +++++ 3 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 src/logger.ts diff --git a/package-lock.json b/package-lock.json index 6605a60..a96d335 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,27 @@ { "name": "function-sdk-typescript", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { + "name": "function-sdk-typescript", + "version": "0.0.1", + "license": "Apache-2.0", "dependencies": { + "@bufbuild/buf": "^1.39.0", + "@bufbuild/protobuf": "^1.10.0", + "@bufbuild/protoc-gen-es": "^1.10.0", + "@connectrpc/connect": "^1.4.0", "@connectrpc/connect-fastify": "^1.4.0", "@connectrpc/connect-node": "^1.4.0", + "@connectrpc/protoc-gen-connect-es": "^1.4.0", "@kubernetes/client-node": "^0.21.0", "fastify": "^4.28.1", + "pino": "^9.4.0", "yargs": "^17.7.2" }, "devDependencies": { - "@bufbuild/buf": "^1.39.0", - "@bufbuild/protobuf": "^1.10.0", - "@bufbuild/protoc-gen-es": "^1.10.0", - "@connectrpc/connect": "^1.4.0", - "@connectrpc/protoc-gen-connect-es": "^1.4.0", "@types/yargs": "^17.0.33", "typescript": "^5.5.4" } @@ -25,7 +30,6 @@ "version": "1.39.0", "resolved": "https://registry.npmjs.org/@bufbuild/buf/-/buf-1.39.0.tgz", "integrity": "sha512-lm7xb9pc7X04rRjCQ69o9byAAZ7/dsUQGoH+iJ9uBSXQWiwQ1Ts8gneBnuUVsAH2vdW73NFBpmNQGE9XtFauVQ==", - "dev": true, "hasInstallScript": true, "bin": { "buf": "bin/buf", @@ -51,7 +55,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -67,7 +70,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -83,7 +85,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -99,7 +100,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -115,7 +115,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -131,7 +130,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -149,7 +147,6 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/@bufbuild/protoc-gen-es/-/protoc-gen-es-1.10.0.tgz", "integrity": "sha512-zBYBsVT/ul4uZb6F+kD7/k4sWNHVVbEPfJwKi0FDr+9VJo8MKIofI6pkr5ksBLr4fi/74r+e/75Xi/0clL5dXg==", - "dev": true, "dependencies": { "@bufbuild/protobuf": "^1.10.0", "@bufbuild/protoplugin": "1.10.0" @@ -173,7 +170,6 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-1.10.0.tgz", "integrity": "sha512-u6NE4vL0lw1+EK4/PiE/SQB7fKO4LRJNTEScIXVOi2x88K/c8WKc/k0KyEaA0asVBMpwekJQZGnRyj04ZtN5Gg==", - "dev": true, "dependencies": { "@bufbuild/protobuf": "1.10.0", "@typescript/vfs": "^1.4.0", @@ -184,7 +180,6 @@ "version": "4.5.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -234,7 +229,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@connectrpc/protoc-gen-connect-es/-/protoc-gen-connect-es-1.4.0.tgz", "integrity": "sha512-/7vQ8Q7mEBhV8qEVh/eifRQlQnf8EJ6weMwCD2DljVAQRlZYcW9SLxjYZhV1uM1ZZqQC7Cw2vvgXRg2XQswHBg==", - "dev": true, "dependencies": { "@bufbuild/protobuf": "^1.7.2", "@bufbuild/protoplugin": "^1.7.2" @@ -418,7 +412,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.0.tgz", "integrity": "sha512-hvJUjNVeBMp77qPINuUvYXj4FyWeeMMKZkxEATEU3hqBAQ7qdTBCUFT7Sp0Zu0faeEtFf+ldXxMEDr/bk73ISg==", - "dev": true, "dependencies": { "debug": "^4.1.1" }, @@ -788,7 +781,6 @@ "version": "4.3.6", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -1362,8 +1354,7 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/oauth-sign": { "version": "0.9.0", @@ -1979,7 +1970,6 @@ "version": "5.5.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 3a94021..317529f 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@connectrpc/protoc-gen-connect-es": "^1.4.0", "@kubernetes/client-node": "^0.21.0", "fastify": "^4.28.1", + "pino": "^9.4.0", "yargs": "^17.7.2" }, "devDependencies": { diff --git a/src/logger.ts b/src/logger.ts new file mode 100644 index 0000000..5e5f974 --- /dev/null +++ b/src/logger.ts @@ -0,0 +1,5 @@ +import pino, { LoggerOptions } from "pino"; + +function getLogger(opts: Pick) { + return pino(opts); +} \ No newline at end of file