Skip to content

Commit

Permalink
Update log format (#44)
Browse files Browse the repository at this point in the history
### What was the problem?

This PR resolves LISK-963

### How was it solved?

* Remove 2nd/3rd params from JSON.stringify
* Update error to be part of the log message

### How was it tested?

* Run locally
  • Loading branch information
shuse2 authored and sameersubudhi committed Sep 10, 2024
1 parent 951477b commit 8c76058
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/utils/LogUtils.ts
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
// Fix to console log in single line, and add error message to log.
import winston from "winston";
import { createNewLogger, createConsoleTransport } from "@uma/logger";

const transports = process.env.DEBUG_LOG === "true" ? [createConsoleTransport()] : [new winston.transports.Console()];
const config = process.env.DEBUG_LOG === "true" ? {} : { createConsoleTransport: false };

export const Logger = createNewLogger(transports, config);

export type DefaultLogLevels = "debug" | "info" | "warn" | "error";
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type { Block, TransactionResponse, TransactionReceipt, Provider } from "@
export { config } from "dotenv";

export { replaceAddressCase } from "@uma/common";
export { Logger, waitForLogger } from "@uma/logger";
export { waitForLogger } from "@uma/logger";

export {
CHAIN_IDs,
Expand Down

0 comments on commit 8c76058

Please sign in to comment.