Skip to content

Commit

Permalink
chore: use separated pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
c-wide committed Mar 20, 2024
1 parent cade272 commit 37f61f8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 73 deletions.
9 changes: 7 additions & 2 deletions features/logs/server/logger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createLogger, transports, format } from "winston";
import { config } from "~/utils/common/config";
import { LogColor, type LogMetadata } from "~/logs/common/misc";
import { FivemanageTransport } from "~/logs/server/transport";
import { FivemanageTransport } from "@fivemanage/winston";
import { getFormattedPlayerIdentifiers } from "~/utils/server/identifiers";
import {
minLength,
Expand All @@ -13,6 +13,7 @@ import {
ValiError,
flatten,
} from "valibot";
import { convars } from "~/utils/server/convars";

const levels = config.logs.levels.reduce<Record<string, number>>(
(acc, curr, idx) => {
Expand Down Expand Up @@ -45,7 +46,11 @@ if (config.logs.console === true) {
}

if (config.logs.enableCloudLogging === true) {
logger.add(new FivemanageTransport());
logger.add(
new FivemanageTransport({
apiKey: convars.FIVEMANAGE_LOGS_API_KEY,
}),
);
}

const LogSchema = object({
Expand Down
66 changes: 0 additions & 66 deletions features/logs/server/transport.ts

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@fivemanage/winston": "^0.1.0",
"@paralleldrive/cuid2": "^2.2.2",
"form-data": "^4.0.0",
"lru-cache": "^10.2.0",
"node-fetch": "2",
"valibot": "^0.29.0",
"winston": "^3.11.0",
"winston-transport": "^4.7.0"
"winston": "^3.11.0"
},
"packageManager": "[email protected]"
}
15 changes: 12 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37f61f8

Please sign in to comment.