Skip to content

Commit

Permalink
fix(ci): fixed ci test with fallback log level
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <[email protected]>

Revert "fix(ci): fixed ci test with fallback log level"

This reverts commit 9af4396.

Reapply "fix(ci): fixed ci test with fallback log level"

This reverts commit bd81c5729ffa7e4e20cf07cccbec718aff61af9b.

Revert "fix(ci): fixed ci test with fallback log level"

This reverts commit 981cad0a66a4e487d6e396dfcc0fa1123f19296f.

Reapply "fix(ci): fixed ci test with fallback log level"

This reverts commit 87eb44fd5fcd09156210cd431d7a0d00e9f8e720.
  • Loading branch information
quiet-node committed Feb 5, 2025
1 parent f99771a commit 67a8e75
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
18 changes: 10 additions & 8 deletions packages/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@
*
*/

import { JsonRpcError, MirrorNodeClientError, predefined, Relay, RelayImpl } from '@hashgraph/json-rpc-relay/dist';
import { ConfigService } from '@hashgraph/json-rpc-config-service/dist/services';
import { JsonRpcError, MirrorNodeClientError, predefined, Relay, RelayImpl } from '@hashgraph/json-rpc-relay/dist';
import { ITracerConfig, RequestDetails } from '@hashgraph/json-rpc-relay/src/lib/types';
import { collectDefaultMetrics, Histogram, Registry } from 'prom-client';
import KoaJsonRpc from './koaJsonRpc';
import { TracerType, TYPES, Validator } from './validator';
import pino from 'pino';
import path from 'path';
import fs from 'fs';
import cors from 'koa-cors';
import path from 'path';
import pino from 'pino';
import { collectDefaultMetrics, Histogram, Registry } from 'prom-client';
import { v4 as uuid } from 'uuid';

import { formatRequestIdMessage } from './formatters';
import cors from 'koa-cors';
import KoaJsonRpc from './koaJsonRpc';
import { TracerType, TYPES, Validator } from './validator';

const mainLogger = pino({
name: 'hedera-json-rpc-relay',
level: ConfigService.get('LOG_LEVEL'),
// Pino requires the default level to be explicitly set; without fallback value ("trace"), an invalid or missing value could trigger the "default level must be included in custom levels" error.
level: ConfigService.get('LOG_LEVEL') || 'trace',
transport: {
target: 'pino-pretty',
options: {
Expand Down
24 changes: 13 additions & 11 deletions packages/ws-server/src/webSocketServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,28 @@
*
*/

import { ConfigService } from '@hashgraph/json-rpc-config-service/dist/services';
import { JsonRpcError, predefined, Relay, RelayImpl } from '@hashgraph/json-rpc-relay/dist';
import { RequestDetails } from '@hashgraph/json-rpc-relay/dist/lib/types';
import KoaJsonRpc from '@hashgraph/json-rpc-server/dist/koaJsonRpc';
import { IJsonRpcRequest } from '@hashgraph/json-rpc-server/dist/koaJsonRpc/lib/IJsonRpcRequest';
import jsonResp from '@hashgraph/json-rpc-server/dist/koaJsonRpc/lib/RpcResponse';
import Koa from 'koa';
import pino from 'pino';
import { v4 as uuid } from 'uuid';
import websockify from 'koa-websocket';
import pino from 'pino';
import { collectDefaultMetrics, Registry } from 'prom-client';
import { v4 as uuid } from 'uuid';

import { getRequestResult } from './controllers';
import { WS_CONSTANTS } from './utils/constants';
import WsMetricRegistry from './metrics/wsMetricRegistry';
import ConnectionLimiter from './metrics/connectionLimiter';
import KoaJsonRpc from '@hashgraph/json-rpc-server/dist/koaJsonRpc';
import jsonResp from '@hashgraph/json-rpc-server/dist/koaJsonRpc/lib/RpcResponse';
import { JsonRpcError, predefined, Relay, RelayImpl } from '@hashgraph/json-rpc-relay/dist';
import WsMetricRegistry from './metrics/wsMetricRegistry';
import { WS_CONSTANTS } from './utils/constants';
import { getBatchRequestsMaxSize, getWsBatchRequestsEnabled, handleConnectionClose, sendToClient } from './utils/utils';
import { ConfigService } from '@hashgraph/json-rpc-config-service/dist/services';
import { IJsonRpcRequest } from '@hashgraph/json-rpc-server/dist/koaJsonRpc/lib/IJsonRpcRequest';
import { RequestDetails } from '@hashgraph/json-rpc-relay/dist/lib/types';

const mainLogger = pino({
name: 'hedera-json-rpc-relay',
level: ConfigService.get('LOG_LEVEL'),
// Pino requires the default level to be explicitly set; without fallback value ("trace"), an invalid or missing value could trigger the "default level must be included in custom levels" error.
level: ConfigService.get('LOG_LEVEL') || 'trace',
transport: {
target: 'pino-pretty',
options: {
Expand Down

0 comments on commit 67a8e75

Please sign in to comment.