Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 829672a commit 1561b30Copy full SHA for 1561b30
web-app/src/services/logger/index.ts
@@ -1,13 +1,19 @@
1
import { LOG } from '../../environment'
2
3
-const logger = (...messages: string[]) => {
+export type Log = string | object | null
4
+
5
+const logger = (...messages: Log[]): void => {
6
if (!LOG) {
7
return
8
}
9
// Inside vscode, you console.log does not allow more than 1 param
10
// to get around it, we can log with multiple log statements
11
for (const message of messages) {
- console.log(message)
12
+ if (typeof message === 'object') {
13
+ console.log(JSON.stringify(message))
14
+ } else {
15
+ console.log(message)
16
+ }
17
18
19
0 commit comments