Skip to content

Commit

Permalink
refactor: intergrate default statement in switch for readability (b22…
Browse files Browse the repository at this point in the history
…790188) (monkeytypegame#4987)

* refactor: intergrate default for readability

* refactor: change undefined to null

* refactor: add color type

* fix coding style problem
  • Loading branch information
TimKuo319 authored Feb 1, 2024
1 parent 8b48347 commit a4bff90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const simpleOutputFormat = format.printf((log) => {
});

const coloredOutputFormat = format.printf((log) => {
let color = infoColor;
let color;

switch (log.level) {
case "error":
Expand All @@ -48,6 +48,9 @@ const coloredOutputFormat = format.printf((log) => {
case "success":
color = successColor;
break;
default:
color = infoColor;
break;
}

return `${log["timestamp"]}\t${color(log.message)}`;
Expand Down

0 comments on commit a4bff90

Please sign in to comment.