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.
2 parents 829672a + 1561b30 commit 184d28cCopy full SHA for 184d28c
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