Skip to content

Commit

Permalink
add template to creative debug
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed Nov 1, 2024
1 parent 7fcef61 commit 26f3817
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import helmet from "helmet";
import dotenv from "dotenv";
import * as Sentry from "@sentry/node";
import { Express } from "express";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:server-config");

export default class Config {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/association.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from "fs";
import path from "path";
import util from "util";
const readFile = util.promisify(fs.readFile);
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:metakg");

export interface AssocResult {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/async/asyncquery_queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "@biothings-explorer/types";
import Queue, { Queue as BullQueue, FailedEventCallback } from "bull";
import axios from "axios";
import { redisClient, getNewRedisClient } from "@biothings-explorer/utils";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
import { TrapiLog, TrapiQueryGraph } from "@biothings-explorer/types";
import { BullJob } from "../../types";
const debug = Debug("bte:biothings-explorer-trapi:asyncquery_queue");
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/cron/clear_edge_cache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { redisClient } from "@biothings-explorer/utils";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:cron");
import cron from "node-cron";

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/cron/update_local_smartapi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:cron");
import axios from "axios";
import fs from "fs/promises";
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/meta_knowledge_graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import meta_kg, { KGQualifiersObject } from "@biothings-explorer/smartapi-kg";
import { snakeCase } from "snake-case";
import path from "path";
import PredicatesLoadingError from "../utils/errors/predicates_error";
const debug = require("debug")("bte:biothings-explorer-trapi:metakg");
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:metakg");
import apiList from "../config/api_list";
import { supportedLookups } from "@biothings-explorer/query_graph_handler";

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/opentelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http";
import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
import { Resource } from "@opentelemetry/resources";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
const debug = Debug("bte:biothings-explorer:otel-init");
import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/threading/taskHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "../opentelemetry";

import { isMainThread, threadId } from "worker_threads";
import Piscina from "piscina";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug(`bte:biothings-explorer-trapi:worker${threadId}`);

if (!isMainThread) {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/threading/threadHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MessageChannel, threadId } from "worker_threads";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
import { context, propagation, trace, Context, Span } from "@opentelemetry/api";
const debug = Debug("bte:biothings-explorer-trapi:threading");
import path from "path";
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { InvalidQueryGraphError, NotImplementedError } from "@biothings-explorer
import PredicatesLoadingError from "../utils/errors/predicates_error";
import MetaKGLoadingError from "../utils/errors/metakg_error";
import ServerOverloadedError from "../utils/errors/server_overloaded_error";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:error_handler");
import * as Sentry from "@sentry/node";
import { Express, NextFunction, Request, Response } from "express";
Expand Down
2 changes: 1 addition & 1 deletion src/routes/bullboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getQueryQueue } from "../controllers/async/asyncquery_queue";
import { createBullBoard } from "@bull-board/api";
import { BullAdapter } from "@bull-board/api/bullAdapter";
import { ExpressAdapter } from "@bull-board/express";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:bullboard");
import { redisClient } from "@biothings-explorer/utils";
import { Express, NextFunction, Request, Response } from "express";
Expand Down
2 changes: 1 addition & 1 deletion src/routes/performance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import fs from "fs";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:performance");
import * as utils from "../utils/common";
import { Express } from "express";
Expand Down
2 changes: 1 addition & 1 deletion src/routes/v1/asyncquery_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as utils from "../../utils/common";

import swaggerValidation from "../../middlewares/validate";
import { runTask, taskResponse, taskError } from "../../controllers/threading/threadHandler";
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:async");
import { Express, NextFunction, Request, RequestHandler, Response } from "express";
import { TaskInfo, TrapiAsyncStatusResponse, TrapiLog, TrapiResponse } from "@biothings-explorer/types";
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Debug from "debug";
import { Debug } from "@biothings-explorer/utils";
const debug = Debug("bte:biothings-explorer-trapi:server-start");

async function main() {
Expand Down

0 comments on commit 26f3817

Please sign in to comment.