Skip to content

Commit

Permalink
Merge pull request #1201 from samchon/feature/console.info
Browse files Browse the repository at this point in the history
Support `console.info()` in playground
  • Loading branch information
samchon authored Aug 6, 2024
2 parents 1667e78 + 9d5179b commit 19a414c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/src/components/playground/ConsoleViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const ConsoleViewer = (props: ConsoleViewer.IProps) => {
? "red"
: msg.type === "warn"
? "yellow"
: "green",
: msg.type === "info"
? "skyblue"
: "lightgreen",
fontWeight: "bold",
}}
>
Expand All @@ -48,7 +50,7 @@ namespace ConsoleViewer {
messages: IMessage[];
}
export interface IMessage {
type: "error" | "log" | "warn";
type: "error" | "info" | "log" | "warn";
value: any;
}
}
Expand Down
4 changes: 4 additions & 0 deletions website/src/pages/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ const Playground = () => {
console.error(...args);
args.forEach((value) => messages.push({ type: "error", value }));
},
info: (...args: any[]) => {
console.info(...args);
args.forEach((value) => messages.push({ type: "info", value }));
},
log: (...args: any[]) => {
console.log(...args);
args.forEach((value) => messages.push({ type: "log", value }));
Expand Down

0 comments on commit 19a414c

Please sign in to comment.