12345678910111213141516171819 |
- import { createEventLogger, createLogger } from "@shared/common/logging";
- import { isHttpError } from "@shared/common/async_utils";
- import { HTTPError } from "got/dist/source";
- export const logger = createLogger({
- errorHandler: (reason) => {
- if (isHttpError<HTTPError>(reason)) {
- return new Error(`HTTPError: ${reason.request.requestUrl} failed because ${reason}\nStack trace: ${reason.stack}`);
- }
- return undefined;
- }
- });
- export const eventLogger = createEventLogger({
- host: process.env.MONGO_DB_HOST ?? "",
- password: process.env.MONGO_DB_USERNAME ?? "",
- username: process.env.MONGO_DB_PASSWORD ?? "",
- name: "NoctBot",
- });
|